<?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>146047</bug_id>
          
          <creation_ts>2015-06-16 22:00:57 -0700</creation_ts>
          <short_desc>REGRESSION(182495): Error&apos;s &quot;column&quot; property should not be readonly</short_desc>
          <delta_ts>2016-08-19 19:01:03 -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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>160984</dup_id>
          
          <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="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ggaren</cc>
    
    <cc>joepeck</cc>
    
    <cc>mark.lam</cc>
    
    <cc>mmirman</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1102471</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-06-16 22:00:57 -0700</bug_when>
    <thetext>* SUMMARY
Error&apos;s &quot;column&quot; property should not be readonly. This used to work in Safari 8, but now fails in ToT WebKit.

* TEST
&lt;script&gt;
&quot;use strict&quot;;
var error = new Error(&apos;My Error Message&apos;);
error.lineNumber = 1;
error.column = 2; // Should not trigger a TypeError.
console.log(&quot;SUCCESS&quot;, error);
&lt;/script&gt;

* STEPS TO REPRODUCE
1. Open attached test case
  =&gt; get an error attempting to set error.column, used to work
  =&gt; [Error] TypeError: Attempted to assign to readonly property.

* NOTES
- Firefox and Chrome do not throw an error
- This is done in the Esprima JS Library, so there may also be other libraries that do this and expect it to work

* DESCRIPTORS
&gt; Object.getOwnPropertyDescriptor(error, &quot;column&quot;)
&lt; {value: 22, writable: false, enumerable: true, configurable: false} = $2
&gt; Object.getOwnPropertyDescriptor(error, &quot;lineNumber&quot;)
&lt; {value: 1, writable: true, enumerable: true, configurable: true} = $3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1102472</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-06-16 22:01:30 -0700</bug_when>
    <thetext>&lt;rdar://problem/21415612&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1102473</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-06-16 22:05:57 -0700</bug_when>
    <thetext>Bisected back to: &lt;http://trac.webkit.org/changeset/182495&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1102474</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-06-16 22:08:00 -0700</bug_when>
    <thetext>&gt; &gt; Object.getOwnPropertyDescriptor(error, &quot;lineNumber&quot;)
&gt; &lt; {value: 1, writable: true, enumerable: true, configurable: true} = $3

Ahh, this is misleading since no such property already existed, this was just added by me.

I think the relevant part of the original change was:

+        obj-&gt;putDirect(vm, vm.propertyNames-&gt;line, jsNumber(line), ReadOnly | DontDelete);
+        obj-&gt;putDirect(vm, vm.propertyNames-&gt;column, jsNumber(column), ReadOnly | DontDelete);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1102481</commentid>
    <comment_count>4</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-06-16 22:33:45 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; &gt; &gt; Object.getOwnPropertyDescriptor(error, &quot;lineNumber&quot;)
&gt; &gt; &lt; {value: 1, writable: true, enumerable: true, configurable: true} = $3
&gt; 
&gt; Ahh, this is misleading since no such property already existed, this was
&gt; just added by me.
&gt; 
&gt; I think the relevant part of the original change was:
&gt; 
&gt; +        obj-&gt;putDirect(vm, vm.propertyNames-&gt;line, jsNumber(line), ReadOnly
&gt; | DontDelete);
&gt; +        obj-&gt;putDirect(vm, vm.propertyNames-&gt;column, jsNumber(column),
&gt; ReadOnly | DontDelete);

Actually the original code had something very similar. So I don&apos;t actually see how this was writable before... but there is certainly some visible change here.

Other browsers have different property names and descriptor attributes for the error properties. There is no standardization at all with Errors. That said, making the property writable seems reasonable.

Firefox:

    js&gt; Object.getOwnPropertyNames(new Error)
    Array [ &quot;fileName&quot;, &quot;lineNumber&quot;, &quot;columnNumber&quot; ]

    js&gt; Object.getOwnPropertyDescriptor(new Error, &quot;lineNumber&quot;)
    Object { value: 1, writable: true, enumerable: false, configurable: true }

Chrome:

    js&gt; Object.getOwnPropertyNames(new Error)
    [&quot;stack&quot;]

    js&gt; Object.getOwnPropertyDescriptor(new Error, &quot;stack&quot;)
    Object {enumerable: false, configurable: true}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1221582</commentid>
    <comment_count>5</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-08-19 19:01:03 -0700</bug_when>
    <thetext>Ended up addressing this in bug 160984.

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

    </bug>

</bugzilla>