Bug 247433 - SyntaxError is thrown when parameter in array pattern and function have same name
Summary: SyntaxError is thrown when parameter in array pattern and function have same ...
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
: 220517 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-11-03 09:09 PDT by Kanguk Lee
Modified: 2023-10-12 15:09 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 09:09:46 PDT
// input.js
( function x ( [ x ] ) { } ( [ ] ) ) ;
__________________________________________

Hello,

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


Running the input.js with JSC results in:

---
$ jsc input.js
Exception: SyntaxError: Duplicate parameter 'x' not allowed in function with destructuring parameters.
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-07 16:48:45 PST
<rdar://problem/102066019>
Comment 2 Yijia Huang 2022-11-08 10:19:27 PST
Pull request: https://github.com/WebKit/WebKit/pull/6257
Comment 3 EWS 2022-11-08 21:54:29 PST
Committed 256478@main (a44c26d2439a): <https://commits.webkit.org/256478@main>

Reviewed commits have been landed. Closing PR #6257 and removing active labels.
Comment 4 Alexey Shvayka 2023-10-12 15:09:54 PDT
*** Bug 220517 has been marked as a duplicate of this bug. ***