Closed
Bug 822283
Opened 7 years ago
Closed 7 years ago
Poison TokenStream::strictMode() when not in the parser
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Not set
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: Benjamin, Unassigned)
References
Details
Attachments
(1 file)
3.57 KB,
patch
|
njn
:
review+
|
Details | Diff | Splinter Review |
After parsing is done, if someone calls TokenStream::strictMode(), the StrictModeGetter will still access the parser's shared context to look for the strict flag. This is wrong when BytecodeEmitter is reporting a strict error a nested strict function (see bug 821470 and bug 821103). TokenStream::strictMode() should be poisoned after parsing, so errors can be detected.
Reporter | ||
Comment 1•7 years ago
|
||
Here's something. It makes APIs that access strictness not directly related to tokenizing private. I removed reportStrictWarning, since it is no longer used.
Attachment #693182 -
Flags: review?(n.nethercote)
![]() |
||
Comment 2•7 years ago
|
||
Comment on attachment 693182 [details] [diff] [review] make strictness apis private Review of attachment 693182 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, thanks. ::: js/src/frontend/TokenStream.h @@ +545,5 @@ > va_list args); > > private: > + // This are private because they should only be called by the tokenizer > + // while tokenizing. Maybe add something like "E.g. they shouldn't be called from the BytecodeEmitter."?
Attachment #693182 -
Flags: review?(n.nethercote) → review+
Reporter | ||
Comment 3•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/391f4cf534e1
Comment 4•7 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/391f4cf534e1
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in
before you can comment on or make changes to this bug.
Description
•