Closed
Bug 1300793
Opened 9 years ago
Closed 9 years ago
ES6: Strict mode functions shouldn't expose "arguments" or "caller" through Reflect.ownKeys
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
INVALID
People
(Reporter: WeirdAl, Unassigned)
References
(Blocks 1 open bug, )
Details
(Keywords: reproducible, testcase)
<script>
"use strict"
function A() {}
</script>
<script>
function B() {}
</script>
<script>
window.onload = function() {
let a = Reflect.ownKeys(A);
let b = Reflect.ownKeys(B);
document.getElementById("output").value = (a.includes("arguments") === b.includes("arguments"));
}
</script>
Mozilla Firefox reports true because both A and B have "arguments" among their own keys. Google Chrome and V8 report false because A does not have "arguments" among its own keys. More specifically, "arguments" and "caller" have their [[Enumerable]] attribute set to false.
Per discussion on the es-discuss mailing list (thread posted via URL field), Google Chrome is probably correct here. What I didn't notice then is that the rule was also in ES6:
http://www.ecma-international.org/ecma-262/6.0/#sec-forbidden-extensions
I'm filing as UNCO because I'm relying on someone else's interpretation of the specifications, and they are pretty dense.
Comment 1•9 years ago
|
||
This bug is invalid.
> Mozilla Firefox reports true because both A and B have "arguments" among their own keys.
No. Mozilla Firefox reports true because neither A nor B have "arguments" among their own keys.
Reporter | ||
Comment 2•9 years ago
|
||
Doh! There's my morning idiocy for the day.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•