RESOLVED FIXED157545
Improve error messages for accessing arguments.callee and similar getters in strict mode
https://bugs.webkit.org/show_bug.cgi?id=157545
Summary Improve error messages for accessing arguments.callee and similar getters in ...
Joseph Pecoraro
Reported 2016-05-10 16:56:31 PDT
* 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.
Attachments
[PATCH] Proposed Fix (24.66 KB, patch)
2016-05-10 16:58 PDT, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2016-05-10 16:58:58 PDT
Created attachment 278552 [details] [PATCH] Proposed Fix
WebKit Commit Bot
Comment 2 2016-05-10 17:00:52 PDT
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.
Mark Lam
Comment 3 2016-05-10 17:08:14 PDT
Comment on attachment 278552 [details] [PATCH] Proposed Fix r=me
WebKit Commit Bot
Comment 4 2016-05-11 11:32:42 PDT
Comment on attachment 278552 [details] [PATCH] Proposed Fix Clearing flags on attachment: 278552 Committed r200694: <http://trac.webkit.org/changeset/200694>
WebKit Commit Bot
Comment 5 2016-05-11 11:32:45 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.