Bug 247426 - Duplicated name in class static block should be normal but throws SyntaxError
Summary: Duplicated name in class static block should be normal but throws SyntaxError
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yijia Huang
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-11-03 08:47 PDT by Kanguk Lee
Modified: 2022-11-04 00:41 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kanguk Lee 2022-11-03 08:47:29 PDT
// input.js
class x { static { var x ; } }
________________________________

Hello,

Executing the input.js using JSC throws SyntaxError, but it is expected to terminate normally.

Running the input.js with JSC gives

---
$ jsc input.js
Exception: SyntaxError: Cannot declare a var variable that shadows a let/const/class variable: 'x'.
at input.js:1
---

while other engines behave like

---
# V8
$ node input.js
// no error

# GraalJS
$ js input.js
// no error
---


WebKit version: 615.1.10
Comment 1 Radar WebKit Bug Importer 2022-11-03 18:06:57 PDT
<rdar://problem/101940195>
Comment 2 Yijia Huang 2022-11-03 22:50:43 PDT
Pull request: https://github.com/WebKit/WebKit/pull/6126
Comment 3 EWS 2022-11-04 00:41:41 PDT
Committed 256311@main (d102e7a7748f): <https://commits.webkit.org/256311@main>

Reviewed commits have been landed. Closing PR #6126 and removing active labels.