mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
LibJS: Disallow 'continue' & 'break' outside of their respective scopes
'continue' is no longer allowed outside of a loop, and an unlabeled 'break' is not longer allowed outside of a loop or switch statement. Labeled 'break' statements are still allowed everywhere, even if the label does not exist.
This commit is contained in:
parent
b85af075b7
commit
e49ea1b520
3 changed files with 44 additions and 5 deletions
|
@ -159,6 +159,8 @@ private:
|
|||
bool m_allow_super_property_lookup { false };
|
||||
bool m_allow_super_constructor_call { false };
|
||||
bool m_in_function_context { false };
|
||||
bool m_in_break_context { false };
|
||||
bool m_in_continue_context { false };
|
||||
|
||||
explicit ParserState(Lexer);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue