<?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>188789</bug_id>
          
          <creation_ts>2018-08-21 05:39:28 -0700</creation_ts>
          <short_desc>Fail to throw TypeError when set a getter-only property in Array.prototype.pop</short_desc>
          <delta_ts>2020-06-07 06:38:22 -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>201910</dup_id>
          
          <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>fpizlo</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1452050</commentid>
    <comment_count>0</comment_count>
    <who name="">sunlili</who>
    <bug_when>2018-08-21 05:39:28 -0700</bug_when>
    <thetext>Executing following code :
---------------------------------------------
function foo()
{
    var obj = {};

    Object.prototype.push = Array.prototype.push;
    Object.prototype.pop = Array.prototype.pop;
    var x;
    Object.defineProperty(obj, &quot;length&quot;, {get: function() {x = true; return 5;}});
    //call set length while pop,but setter was undefined
    x = false;

    try
    {
        var len = obj.pop();
    }
    catch (e)
    {
        print(&apos;caught exception:&apos;);
        print(e);
    }
    print(x);
}
foo();

print(&quot;BT_FLAG&quot;);
-----------------------------------------------------

Output should be :
caught exception:
TypeError: setting getter-only property &quot;length&quot;
true
BT_FLAG

However, output of JavaScriptCore:
true
BT_FLAG



BT_GROUP
2018/8/21</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1660054</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2020-06-07 06:38:22 -0700</bug_when>
    <thetext>r250275 fixed putLength() with unsuccessful [[Set]], including Array.prototype.pop case.
test262 coverage: https://github.com/tc39/test262/pull/2463.

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

    </bug>

</bugzilla>