mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:37:45 +00:00
LibJS: Allow statements to have multiple labels
This is a curious thing that occurs more often than you'd think in minified JavaScript: a: b: c: for (...) { ... break b; ... }
This commit is contained in:
parent
ababcc5725
commit
3252d984ae
6 changed files with 31 additions and 21 deletions
|
@ -621,7 +621,7 @@ RefPtr<Statement> Parser::try_parse_labelled_statement(AllowLabelledFunction all
|
|||
|
||||
m_state.labels_in_scope.remove(identifier);
|
||||
|
||||
labelled_statement->set_label(identifier);
|
||||
labelled_statement->add_label(identifier);
|
||||
state_rollback_guard.disarm();
|
||||
discard_saved_state();
|
||||
return labelled_statement.release_nonnull();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue