WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
247787
Order between tdz error and others in `for` statement or class
https://bugs.webkit.org/show_bug.cgi?id=247787
Summary
Order between tdz error and others in `for` statement or class
Kanguk Lee
Reported
2022-11-11 01:13:07 PST
// case 1 // input1.js for ( let x in x = new 0 ) ; // case 2 // input2.js class x { [ x = new 0 ] ; } ____________________________ Hello, Executing the input.js using JSC throws ReferenceError, but TypeError is expected. Running the input1.js and input2.js with JSC results in: --- $ jsc input1.js Exception: ReferenceError: Cannot access uninitialized variable. global
code@input1.js
:1:25 $ jsc input2.js Exception: ReferenceError: Cannot access uninitialized variable. global
code@input2.js
:1:1 --- while other engines behave like: --- # V8 (used console.log) $ node input1.js input1.js:1 for ( let x in x = new 0 ) ; ^ TypeError: 0 is not a constructor ... $ node input2.js input2.js:1 class x { [ x = new 0 ] ; } ^ TypeError: number 0 is not a constructor ... Node.js v18.11.0 # GraalJS $ js input1.js TypeError: 0 is not a constructor at <js> :program(input1.js:1:19-23) $ js input2.js TypeError: 0 is not a constructor at <js> :program(input2.js:1:16-20) --- WebKit version: 615.1.10
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2022-11-14 09:38:43 PST
<
rdar://problem/102324888
>
David Degazio
Comment 2
2022-11-15 15:04:03 PST
Pull request:
https://github.com/WebKit/WebKit/pull/6532
EWS
Comment 3
2022-11-16 10:21:49 PST
Committed
256743@main
(876accfa73f6): <
https://commits.webkit.org/256743@main
> Reviewed commits have been landed. Closing PR #6532 and removing active labels.
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