ES5 strict mode: redeclaration of eval or arguments is not permitted

RESOLVED FIXED

Status

()

RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: jimb, Assigned: jimb)

Tracking

(Blocks: 1 bug)

Trunk
x86
Linux
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

9 years ago
From ES5 Annex C:

It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code and its Identifier is eval or arguments (12.2.1).
(Assignee)

Comment 1

9 years ago
Created attachment 404933 [details] [diff] [review]
Forbid rebinding 'eval' or 'arguments' in ES5 strict mode code.
Assignee: general → jim
Status: NEW → ASSIGNED
Attachment #404933 - Flags: review?(sayrer)
(Assignee)

Updated

9 years ago
Duplicate of this bug: 514577
(Assignee)

Updated

9 years ago
Duplicate of this bug: 514579
(Assignee)

Updated

9 years ago
Duplicate of this bug: 514582
(Assignee)

Updated

9 years ago
Duplicate of this bug: 516996
(Assignee)

Comment 6

9 years ago
Created attachment 412439 [details] [diff] [review]
Forbid rebinding 'eval' or 'arguments' in ES5 strict mode code.

Now, with tests.  sayrer said he wasn't the right person to review this, so mrbkap gets tagged.
Attachment #404933 - Attachment is obsolete: true
Attachment #412439 - Flags: review?(mrbkap)
Attachment #404933 - Flags: review?(sayrer)
Comment on attachment 412439 [details] [diff] [review]
Forbid rebinding 'eval' or 'arguments' in ES5 strict mode code.

+++ b/js/src/jsparse.cpp
@@ -1220,41 +1220,89 @@ CheckStrictAssignment(JSContext *cx, JST
+            js_ReportStrictModeError(cx, TS(tc->compiler), tc, pn,
+                                    JSMSG_BAD_BINDING, name);

Nit: second line is underindented by one space.
Attachment #412439 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 8

9 years ago
http://hg.mozilla.org/tracemonkey/rev/ace9ea745215
Whiteboard: fixed-in-tracemonkey
(Assignee)

Updated

9 years ago
Flags: in-testsuite+
This patch added TCF_FUN_PARAM_EVAL but used 0x10000 for its value, which collides with the value of the pre-existing TCF_DECL_DESTRUCTURING macro. Please file and fix, r?mrbkap :-/.

/be
(Assignee)

Comment 10

9 years ago
(In reply to comment #9)
> This patch added TCF_FUN_PARAM_EVAL but used 0x10000 for its value, which
> collides with the value of the pre-existing TCF_DECL_DESTRUCTURING macro.
> Please file and fix, r?mrbkap :-/.

Filed as bug 532254.
Fixed in m-c a while ago:

http://hg.mozilla.org/mozilla-central/rev/ace9ea745215

/be
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.