Bug 159645 - Array.prototype.splice is wrong w.r.t ES6 spec
Summary: Array.prototype.splice is wrong w.r.t ES6 spec
Status: RESOLVED DUPLICATE of bug 171591
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-11 14:44 PDT by Saam Barati
Modified: 2017-05-03 16:27 PDT (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-07-11 14:44:06 PDT
Specifically, this code is wrong:
```
            for (unsigned k = 0; k < deleteCount; ++k) {
                JSValue v = getProperty(exec, thisObj, k + begin);
                if (UNLIKELY(vm.exception()))
                    return JSValue::encode(jsUndefined());
                if (!v)
                    continue;
                result->putByIndexInline(exec, k, v, true);
                if (UNLIKELY(vm.exception()))
                    return JSValue::encode(jsUndefined());
            }
```
We should be calling defineOwnProperty.
See spec:
https://tc39.github.io/ecma262/#sec-array.prototype.splice
and
https://tc39.github.io/ecma262/#sec-createdatapropertyorthrow
Comment 1 Saam Barati 2017-05-03 16:27:12 PDT

*** This bug has been marked as a duplicate of bug 171591 ***