Closed
Bug 822283
Opened 13 years ago
Closed 13 years ago
Poison TokenStream::strictMode() when not in the parser
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: Benjamin, Unassigned)
References
Details
Attachments
(1 file)
|
3.57 KB,
patch
|
n.nethercote
:
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•13 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•13 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•13 years ago
|
||
Comment 4•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in
before you can comment on or make changes to this bug.
Description
•