[Webkit-unassigned] [Bug 247428] New: Reassigning to class name during static field initialization

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 3 08:52:52 PDT 2022


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

            Bug ID: 247428
           Summary: Reassigning to class name during static field
                    initialization
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: p51lee at kaist.ac.kr

// input.js
class x { static #y = { x = 0 } = 0 ; }
__________________________________________

Hello,

Executing the input.js using JSC throws ReferenceError.
However, it is expected to throw TypeError.

Running the input.js with JSC results in:

---
$ jsc input.js
Exception: ReferenceError: Cannot access uninitialized variable.
global code at input.js:1:1
---

while other engines behave like:

---
# V8
$ node input.js
input.js:1: TypeError: Assignment to constant variable.
class x { static #y = { x = 0 } = 0 ; }
                        ^
TypeError: Assignment to constant variable.
    at <static_initializer> (input.js:1:25)
    at input.js:1:1

# GraalJS
$ js input.js
TypeError: Assignment to constant "x"
        at <js> :initializer(input.js:1:24)
        at <js> :program(input.js:1:0-38)
---


WebKit version: 615.1.10

-- 
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/20221103/658af730/attachment-0001.htm>


More information about the webkit-unassigned mailing list