1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

LibJS: Update a couple of outdated spec comments

These are editorial changes in the ECMA-262 spec.

See:
- e080a7f
- c5a9094
- 5091520
- 1c6564b
- e06c80c
This commit is contained in:
Linus Groh 2022-04-30 22:22:52 +02:00
parent ce659e5eeb
commit 5a26a547db
6 changed files with 12 additions and 10 deletions

View file

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Stephan Unverwerth <s.unverwerth@serenityos.org>
* Copyright (c) 2020-2021, Linus Groh <linusg@serenityos.org>
* Copyright (c) 2020-2022, Linus Groh <linusg@serenityos.org>
* Copyright (c) 2021-2022, David Tuin <davidot@serenityos.org>
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
* Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
@ -3343,9 +3343,12 @@ NonnullRefPtr<IfStatement> Parser::parse_if_statement()
auto rule_start = push_start();
auto parse_function_declaration_as_block_statement = [&] {
// https://tc39.es/ecma262/#sec-functiondeclarations-in-ifstatement-statement-clauses
// Code matching this production is processed as if each matching occurrence of
// This production only applies when parsing non-strict code. Source text matched
// by this production is processed as if each matching occurrence of
// FunctionDeclaration[?Yield, ?Await, ~Default] was the sole StatementListItem
// of a BlockStatement occupying that position in the source code.
// of a BlockStatement occupying that position in the source text.
// The semantics of such a synthetic BlockStatement includes the web legacy
// compatibility semantics specified in B.3.2.
VERIFY(match(TokenType::Function));
auto block = create_ast_node<BlockStatement>({ m_state.current_token.filename(), rule_start.position(), position() });
ScopePusher block_scope = ScopePusher::block_scope(*this, *block);