[webkit-changes] [WebKit/WebKit] b9e63f: Fix statement depth for parsing static block

EWS noreply at github.com
Tue Feb 7 13:44:22 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b9e63fd65e3227bf91161cd6ab87ca59dd23f679
      https://github.com/WebKit/WebKit/commit/b9e63fd65e3227bf91161cd6ab87ca59dd23f679
  Author: Yijia Huang <yijia_huang at apple.com>
  Date:   2023-02-07 (Tue, 07 Feb 2023)

  Changed paths:
    A JSTests/stress/class-static-block-function-variable-declaration.js
    M Source/JavaScriptCore/parser/Parser.cpp

  Log Message:
  -----------
  Fix statement depth for parsing static block
https://bugs.webkit.org/show_bug.cgi?id=251760
rdar://105104494

Reviewed by Mark Lam.

Static block is treated as a function in spec, that is it should be
parsed as a function and executed as a function invocation. However,
the implementation of parsing class static block is based on
parseBlockStatement. To be consistent with the function environment
during parsing, we should initialize the statement depth to 0.

* JSTests/stress/function-lexical-declaration.js: Added.
(A.C):
(A):
* Source/JavaScriptCore/parser/Parser.h:
(JSC::Scope::declareFunction):

Canonical link: https://commits.webkit.org/259981@main




More information about the webkit-changes mailing list