Status: New
Owner: ----
New issue 3982 by [email protected]: Forbidden Extensions on function objects
https://code.google.com/p/v8/issues/detail?id=3982
Version: 22d62cea4d4d01d30286411cd11a6f3e15083cc0 (Thu Mar 19 08:04:47 2015
-0700)
OS: Ubuntu Linux
Architecture: x64
Various function objects incorrectly define own properties named `arguments`
and `caller`:
d8> Object.hasOwnProperty.call(() => {}, 'caller');
true
d8> Object.hasOwnProperty.call(() => {}, 'arguments');
true
d8> function* G1() {}; Object.hasOwnProperty.call(G1, 'caller');
true
d8> function* G2() {}; Object.hasOwnProperty.call(G2, 'arguments');
true
d8> Object.hasOwnProperty.call(function* () {}, 'caller');
true
d8> Object.hasOwnProperty.call(function* () {}, 'arguments');
true
d8> class C1 {}; Object.hasOwnProperty.call(C1, 'caller');
true
d8> class C2 {}; Object.hasOwnProperty.call(C2, 'arguments');
true
d8> Object.hasOwnProperty.call(class {}, 'caller');
true
d8> Object.hasOwnProperty.call(class {}, 'arguments');
true
This is in violation of ES6 16.1 [1]:
Other than as defined in this specification, ECMAScript Function objects
defined using syntactic constructors in strict mode code must not be
created
with own properties named "caller" or "arguments" other than those that
are
created by applying the AddRestrictedFunctionProperties abstract operation
(9.2.7) to the function. Such own properties also must not be created for
function objects defined using an ArrowFunction, MethodDefinition,
GeneratorDeclaration, GeneratorExpression, ClassDeclaration, or
ClassExpression regardless of whether the definition is contained in
strict
mode code. Built-in functions, strict mode functions created using the
Function constructor, generator functions created using the Generator
constructor, and functions created using the bind method also must not be
created with such own properties.
[1]
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-forbidden-extensions
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.