Closed Bug 541455 Opened 15 years ago Closed 15 years ago

Do not drop "mumble"; would-be directives in the parser, let them be completion values (or useless expressions for the emitter to cull)

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: brendan, Assigned: brendan)

References

(Blocks 1 open bug)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

RecognizeDirectivePrologue returns true for any string literal, eliminating constant string expression statements even when they are wanted as the completion value (e.g., via eval or a special API). Dave Herman ran into this just now using JSCompiler::parse. /be
No longer blocks: 514580, 514559, 514560, 514567, 514572, 514576
Attached patch fix (deleted) — Splinter Review
ES5 14.1 pretty clearly says directives are evaluated, which implies that one in the completion position supplies the completion value. There's no requirement for non-empty body after directive prologue. /be
Attachment #423030 - Flags: review?(jim)
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.9.3a1
Attachment #423030 - Flags: review?(jim) → review+
Summary: ES5 strict mode: recognize "use strict" directives in Directive Prologue → Do not drop "mumble"; would-be directives in the parser, let them be completion values (or useless expressions for the emitter to cull)
Whiteboard: fixed-in-tracemonkey
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
is there a test for this?
Flags: in-testsuite?
(In reply to comment #4) > is there a test for this? Sorry, should have included these: http://hg.mozilla.org/tracemonkey/rev/3f3a9abc3b8f http://hg.mozilla.org/tracemonkey/rev/3f65f66f4468 /be
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: