summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Parser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp
index 2c03379728..b423529c68 100644
--- a/Userland/Libraries/LibJS/Parser.cpp
+++ b/Userland/Libraries/LibJS/Parser.cpp
@@ -1680,6 +1680,10 @@ NonnullRefPtr<VariableDeclaration> Parser::parse_variable_declaration(bool for_l
consume(TokenType::Identifier).value());
} else if (auto pattern = parse_binding_pattern()) {
target = pattern.release_nonnull();
+ } else if (!m_state.in_generator_function_context && match(TokenType::Yield)) {
+ target = create_ast_node<Identifier>(
+ { m_state.current_token.filename(), rule_start.position(), position() },
+ consume().value());
}
if (target.has<Empty>()) {