| Summary: | Array destructuring seems to not follow the ES6 spec | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Boris Zbarsky <bzbarsky> |
| Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | arv, ysuzuki |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 38410 | ||
I guess this is fixed by this commit[1]. I've tried it with r185990's JSC shell and get "PASS". var y = "FAIL"; Object.defineProperty(Array.prototype, 0, { get: function() { y = "PASS"; } }); var [,x] = [,1]; print(y); Could you tell me the revision number? [1]: http://trac.webkit.org/changeset/185853 Ah, this commit[1]. [1]: http://trac.webkit.org/changeset/185791 Looks like I was on r185625. I can confirm that http://trac.webkit.org/changeset/185791 looks like it should fix this, and that it's fixed in r185958. Sorry for the spurious bug report. :( (In reply to comment #3) > Looks like I was on r185625. > > I can confirm that http://trac.webkit.org/changeset/185791 looks like it > should fix this, and that it's fixed in r185958. Sorry for the spurious bug > report. :( No problem!! I'm looking forward to seeing your reports about the other ES6 edge case areas!!! |
Consider this testcase: var y = "FAIL"; Object.defineProperty(Array.prototype, 0, { get: function() { y = "PASS"; } }); var [,x] = [,1]; alert(y); per spec, this should alert "PASS". In Safari (and in a WebKit nightly), this alerts "FAIL".