[Webkit-unassigned] [Bug 247786] New: Re-assignment to constant variable in for-in head

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 11 01:00:17 PST 2022


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

            Bug ID: 247786
           Summary: Re-assignment to constant variable in for-in head
           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
const x = 0 ; for ( { x } in [ 1 ] ) ; 
_____________________

Hello,

Executing the input.js using JSC, it terminates normally, but TypeError is expected since there is an assignment to const.

Running the input.js with JSC results in:

---
$ jsc input.js
async
---

while other engines behave like:

---
# V8 (used console.log)
$ node input.js
input.js:1
const x = 0 ; for ( { x } in [ 1 ] ) ;
                      ^

TypeError: Assignment to constant variable.
    at Object.<anonymous> (input.js:1:23)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47

Node.js v18.11.0

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


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/20221111/a467dcca/attachment.htm>


More information about the webkit-unassigned mailing list