<?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>186992</bug_id>
          
          <creation_ts>2018-06-24 23:54:32 -0700</creation_ts>
          <short_desc>Different output compared with other JS engines</short_desc>
          <delta_ts>2020-05-07 15:40:19 -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>DUPLICATE</resolution>
          <dup_id>184267</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=186991</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=186993</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>sunlili</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ashvayka</cc>
    
    <cc>sunlili</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1435995</commentid>
    <comment_count>0</comment_count>
    <who name="">sunlili</who>
    <bug_when>2018-06-24 23:54:32 -0700</bug_when>
    <thetext>Hello,
The following code behaves incorrectly (inconsistent with the standard and other engines).

arr0 = [ 1, 2, 3 ];
arr1 = [ 4, 5, 6 ]; 
handler1 = { 
    get: function (oTarget, sKey) { 
       print(&apos;arg &apos; + &apos;1&apos; + &apos;:get &apos; + sKey.toString()); 
       if (sKey.toString() == &apos;Symbol(Symbol.isConcatSpreadable)&apos;) {
        return true; } 
       if (sKey.toString() == &apos;length&apos;) { 
        arr1[0] = { 0: &apos;a&apos;, true: &apos;b&apos;, 2: &apos;c&apos; }; 
       } 
       if (Number(sKey.toString()) != NaN) { 
        arr0[1] = [ 1, 2, 3 ]; 
        arr0[2] = {}; return false; 
       }
       return Reflect.get(oTarget, sKey); 
    }, 
    has: function (oTarget, sKey) { 
       print(&apos;arg &apos; + &apos;1&apos; + &apos;:has &apos; + sKey.toString()); 
       if (Number(sKey.toString()) != NaN) {
          return [ 1, 2, 3 ]; } 
       return Reflect.has(oTarget, sKey);
    } 
}; 
var proxy1 = new Proxy(arr1, handler1); 
arr2 = Array.prototype.concat.call(arr0, proxy1); 
print(arr2);

Output is:
arg 1:get Symbol(Symbol.isConcatSpreadable)
arg 1:get Symbol(Symbol.isConcatSpreadable)
arg 1:get length
1,2,3

However, it should be:
arg 1:get Symbol(Symbol.isConcatSpreadable)
arg 1:get length
1,2,3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650385</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2020-05-07 15:40:13 -0700</bug_when>
    <thetext>(In reply to sunlili from comment #0)
&gt; However, it should be:
&gt; arg 1:get Symbol(Symbol.isConcatSpreadable)
&gt; arg 1:get length
&gt; 1,2,3

As of r232261, JSC outputs as expected.

*** This bug has been marked as a duplicate of bug 184267 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>