Closed Bug 514575 Opened 15 years ago Closed 14 years ago

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

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jimb, Assigned: jimb)

References

(Blocks 1 open bug)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 1 obsolete file)

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: general → jim
Status: NEW → ASSIGNED
Attachment #404933 - Flags: review?(sayrer)
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+
http://hg.mozilla.org/tracemonkey/rev/ace9ea745215
Whiteboard: fixed-in-tracemonkey
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
(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
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: