<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>247433</bug_id>
          
          <creation_ts>2022-11-03 09:09:46 -0700</creation_ts>
          <short_desc>SyntaxError is thrown when parameter in array pattern and function have same name</short_desc>
          <delta_ts>2023-10-12 15:09:54 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kanguk Lee">p51lee</reporter>
          <assigned_to name="Yijia Huang">yijia_huang</assigned_to>
          <cc>mark.lam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ychris2010-1</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1910071</commentid>
    <comment_count>0</comment_count>
    <who name="Kanguk Lee">p51lee</who>
    <bug_when>2022-11-03 09:09:46 -0700</bug_when>
    <thetext>// 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 &apos;x&apos; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910936</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-07 16:48:45 -0800</bug_when>
    <thetext>&lt;rdar://problem/102066019&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911044</commentid>
    <comment_count>2</comment_count>
    <who name="Yijia Huang">yijia_huang</who>
    <bug_when>2022-11-08 10:19:27 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/6257</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911174</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-11-08 21:54:29 -0800</bug_when>
    <thetext>Committed 256478@main (a44c26d2439a): &lt;https://commits.webkit.org/256478@main&gt;

Reviewed commits have been landed. Closing PR #6257 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1984738</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2023-10-12 15:09:54 -0700</bug_when>
    <thetext>*** Bug 220517 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>