Arrow function should raise exception ReferenceError only when access to 'arguments' in strict mode in top level arrow function. 'use strict'; var arr = (error) => { if (error) { return arguments; } else { return []; } }; arr(false) === []; arr(true); // ReferenceError
It seems that it is not important is this strict mode or not, just arrow function on top level.
Created attachment 271441 [details] Patch Added tests
Comment on attachment 271441 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=271441&action=review > LayoutTests/js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js:2 > +// Ignore this test in run-jsc-stress-tests, but run in run-webkit-tests > +//@ skip Why?
Comment on attachment 271441 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=271441&action=review >> LayoutTests/js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js:2 >> +//@ skip > > Why? jsc always has arguments http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/jsc.cpp#L758 so I skip tests in jsc But in browser we do not have arguments, so I'm checking only for browser.
Comment on attachment 271441 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=271441&action=review >>> LayoutTests/js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js:2 >>> +//@ skip >> >> Why? > > jsc always has arguments http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/jsc.cpp#L758 so I skip tests in jsc > But in browser we do not have arguments, so I'm checking only for browser. Ok. Can you add that to your comment in the test?
Created attachment 271572 [details] Patch Fix comments
(In reply to comment #5) > Comment on attachment 271441 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=271441&action=review > > >>> LayoutTests/js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js:2 > >>> +//@ skip > >> > >> Why? > > > > jsc always has arguments http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/jsc.cpp#L758 so I skip tests in jsc > > But in browser we do not have arguments, so I'm checking only for browser. > > Ok. Can you add that to your comment in the test? Fixed
Comment on attachment 271572 [details] Patch Clearing flags on attachment: 271572 Committed r196718: <http://trac.webkit.org/changeset/196718>
All reviewed patches have been landed. Closing bug.