Closed Bug 1030263 Opened 6 years ago Closed 5 years ago

Prohibit top-level let declarations in self-hosted code

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(1 file)

If the comment in the patch doesn't explain it enough, poke me and I can explain harder.  :-)  We don't have any of these right now -- this just prevents them from being added, which would pose issues for the work occurring in bug 589199.
Comment on attachment 8446026 [details] [diff] [review]
Make top-level let in self-hosted code a syntax error

Review of attachment 8446026 [details] [diff] [review]:
-----------------------------------------------------------------

I guess we could instead also treat 'let' like 'var' and use JSOP_SELFHOSTEDNAME, but this certainly makes more sense.

Ideally, we'd not even allow 'var', but only 'const', as the self-hosting compartment is read-only after initialization. That's not particularly important, though, as any code attempting to change a var later on will just fail spectacularly so won't ever land.
Attachment #8446026 - Flags: review?(till) → review+
https://hg.mozilla.org/mozilla-central/rev/98449cae7ce1
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.