WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
247788
Invalid postfix operator and nullish coaleascing inside a block in strict mode
https://bugs.webkit.org/show_bug.cgi?id=247788
Summary
Invalid postfix operator and nullish coaleascing inside a block in strict mode
Kanguk Lee
Reported
2022-11-11 01:16:24 PST
// 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@input.js
:3:10 global
code@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
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2022-11-14 09:34:19 PST
<
rdar://problem/102324685
>
Ross Kirsling
Comment 2
2022-11-21 17:24:41 PST
This is already a TypeError in current JSC; seems like something must have changed since the last Safari TP release.
Justin Michaud
Comment 3
2023-03-14 16:13:05 PDT
Yes, this seems to be fixed. Thanks for reporting!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug