Bug 220517 - SyntaxError Duplicate parameter in function with destructuring with assignment
Summary: SyntaxError Duplicate parameter in function with destructuring with assignment
Status: RESOLVED DUPLICATE of bug 247433
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 10.15
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2021-01-11 11:26 PST by Chris
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 Chris 2021-01-11 11:26:25 PST
Webkit throws a SyntaxError with message "Duplicate parameter <name> not allowed in function with destructuring parameters." when attempting to assign a function to another variable. This does not occur if the function is declared separately from the assignment.

Works:

function a({ test: a }) { console.log(a); }
let b = a;

Throws SyntaxError:

let b = function a({ test: a }) { console.log(a); };


Reproduced with Webkit build 271364
Comment 1 Radar WebKit Bug Importer 2021-01-18 11:27:12 PST
<rdar://problem/73327300>
Comment 2 Alexey Shvayka 2023-10-12 15:09:54 PDT
This was fixed in https://commits.webkit.org/256478@main

*** This bug has been marked as a duplicate of bug 247433 ***