[Webkit-unassigned] [Bug 251760] New: Functions are lexically scoped inside static blocks where variable declarations are allowed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 5 11:48:11 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=251760

            Bug ID: 251760
           Summary: Functions are lexically scoped inside static blocks
                    where variable declarations are allowed
           Product: WebKit
           Version: WebKit Local Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Trivial
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: c0dineDev at gmail.com

In Source/JavaScriptCore/parser/Parser.h we hit the assertion: ASSERT_WITH_MESSAGE(!m_declaredVariables.size(), "...");

This is triggered by a simple case where a class function is declared inside of a static scope:

class A {
  static {
    var B;
    function C() {}
  }
}

What's interesting is that I would assume the variables inside that block would be scoped to that class statically, IE the variable B would be accessible through A.B, but that simply is not the case.
It's not a pressing concern, but it seems like a possible regression of https://bugs.webkit.org/show_bug.cgi?id=168844

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230205/d3234838/attachment.htm>


More information about the webkit-unassigned mailing list