Bug 148681 - Functions with non-simple parameter list should have poisoned arguments.callee and arguments.caller (even outside strict mode)
Summary: Functions with non-simple parameter list should have poisoned arguments.calle...
Status: RESOLVED DUPLICATE of bug 217574
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-01 10:11 PDT by Claude Pache
Modified: 2020-12-11 22:24 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claude Pache 2015-09-01 10:11:12 PDT
For example:

    (function (x = 1) { return arguments.callee })() // should throw, even in sloppy mode

For reference, see step 22 of: http://www.ecma-international.org/ecma-262/6.0/#sec-functiondeclarationinstantiation

In short, the spec recognizes two types of Arguments objects:
* mapped Arguments object, used for sloppy-mode simple-parameter-list functions;
* unmapped Arguments object with poisoned `callee`/`caller`, used for anything else.
Comment 1 Alexey Shvayka 2020-12-11 22:24:53 PST
`arguments.caller` poisoned getter was removed from the spec: please see note 5 of https://tc39.es/ecma262/#sec-arguments-exotic-objects.
`arguments.callee` poisoned getter for sloppy functions with non-simple parameter list was implemented in r268323.
  ^ test262 case: https://test262.report/browse/built-ins/ThrowTypeError/unique-per-realm-non-simple.js.

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