diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-26 18:16:06 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-26 18:24:19 +0200 |
commit | 3252d984aee0fc208586cf26a05967f8b8d2a9d5 (patch) | |
tree | 588c8803e529b0b25df0f077e4b42f845599409a /Userland/Libraries/LibJS/Interpreter.cpp | |
parent | ababcc5725dcae0980cb1d76f9178cbc805ba9f7 (diff) | |
download | serenity-3252d984aee0fc208586cf26a05967f8b8d2a9d5.zip |
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; ... }
Diffstat (limited to 'Userland/Libraries/LibJS/Interpreter.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Interpreter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Interpreter.cpp b/Userland/Libraries/LibJS/Interpreter.cpp index 0d7ff1a346..04d5d64f01 100644 --- a/Userland/Libraries/LibJS/Interpreter.cpp +++ b/Userland/Libraries/LibJS/Interpreter.cpp @@ -193,7 +193,7 @@ Value Interpreter::execute_statement(GlobalObject& global_object, const Statemen if (!value.is_empty()) last_value = value; if (vm().should_unwind()) { - if (!block.label().is_null() && vm().should_unwind_until(ScopeType::Breakable, block.label())) + if (!block.labels().is_empty() && vm().should_unwind_until(ScopeType::Breakable, block.labels())) vm().stop_unwind(); break; } |