* SUMMARY Improve error messages for accessing arguments.callee and similar getters in strict mode. Error should be more like accessing callee inside of a class context. * BEFORE: >>> (function() { "use strict"; arguments.callee })() Exception: TypeError: Type error >>> (function() { "use strict"; arguments.callee }).arguments Exception: TypeError: Type error >>> class Foo { method() { arguments.callee; } }; (new Foo).method() Exception: TypeError: 'callee' and 'caller' cannot be accessed in strict mode. * AFTER: >>> (function() { "use strict"; arguments.callee })() Exception: TypeError: 'callee' and 'caller' cannot be accessed in strict mode. >>> (function() { "use strict"; arguments.callee }).arguments Exception: TypeError: 'caller' and 'arguments' cannot be accessed in strict mode. >>> class Foo { method() { arguments.callee; } }; (new Foo).method() Exception: TypeError: 'callee' and 'caller' cannot be accessed in strict mode.
Created attachment 278552 [details] [PATCH] Proposed Fix
Attachment 278552 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/JSGlobalObject.cpp:399: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/runtime/JSGlobalObject.cpp:407: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 2 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 278552 [details] [PATCH] Proposed Fix r=me
Comment on attachment 278552 [details] [PATCH] Proposed Fix Clearing flags on attachment: 278552 Committed r200694: <http://trac.webkit.org/changeset/200694>
All reviewed patches have been landed. Closing bug.