[Webkit-unassigned] [Bug 247788] New: Invalid postfix operator and nullish coaleascing inside a block in strict mode

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 11 01:16:24 PST 2022


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

            Bug ID: 247788
           Summary: Invalid postfix operator and nullish coaleascing
                    inside a block in strict mode
           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
"use strict";
function f() {
  x = (``.p++) ?? 0;
  let x;
}

f();
_____________________

Hello,

Executing the input.js using JSC, it throws ReferenceError but TypeError is expected.

Running the input.js with JSC results in:

---
$ jsc input.js
Exception: ReferenceError: Cannot access uninitialized variable.
f at input.js:3:10
global code at input.js:7:2
---

while other engines behave like:

---
# V8 (used console.log)
$ node input.js
input.js:3
  x = (``.p++) ?? 0;
           ^

TypeError: Cannot create property 'p' on string ''
...

Node.js v18.11.0

# GraalJS
$ js input.js
TypeError: Cannot assign to read only property 'p' of
        at <js> f(input.js:3:35-42)
        at <js> :program(input.js:7:62-64)
---


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/c6d8b8ac/attachment-0001.htm>


More information about the webkit-unassigned mailing list