<?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>145460</bug_id>
          
          <creation_ts>2015-05-29 10:17:12 -0700</creation_ts>
          <short_desc>Make Function.(name|length) configurable</short_desc>
          <delta_ts>2016-05-25 10:51:57 -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>WORKSFORME</resolution>
          
          
          <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 name="Yury Selivanov">yselivanov</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>ggaren</cc>
    
    <cc>gskachkov</cc>
    
    <cc>mark.lam</cc>
    
    <cc>yselivanov</cc>
    
    <cc>zcorpan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1098130</commentid>
    <comment_count>0</comment_count>
    <who name="Yury Selivanov">yselivanov</who>
    <bug_when>2015-05-29 10:17:12 -0700</bug_when>
    <thetext>This is an important feature for OOP libraries: typically classes are emulated using functions, hence class *static* properties are properties of the function object that represents the class.  Since &apos;.name&apos; and &apos;.length&apos; properties are read-only and non-configurable for functions, there is no way to have &apos;.name&apos; and &apos;.length&apos; static properties for classes.

This is something that has already been fixed in Chrome and Firefox:

- https://bugzilla.mozilla.org/show_bug.cgi?id=1084019
- https://chromium.googlesource.com/v8/v8/+/f6cd009efd7a032907b11265e74102b0d45207a1%5E!/

And InternetExplorer doesn&apos;t have any restrictions on these properties, which leaves WebKit/Safari the only browser that doesn&apos;t support this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1098131</commentid>
    <comment_count>1</comment_count>
    <who name="Yury Selivanov">yselivanov</who>
    <bug_when>2015-05-29 10:23:59 -0700</bug_when>
    <thetext>In short, the following should work:

function f(){};
Object.defineProperty(f, &apos;name&apos;, {value: &apos;g&apos;});</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1196259</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters (:zcorpan)">zcorpan</who>
    <bug_when>2016-05-25 03:08:19 -0700</bug_when>
    <thetext>*** Bug 158062 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1196260</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pieters (:zcorpan)">zcorpan</who>
    <bug_when>2016-05-25 03:13:59 -0700</bug_when>
    <thetext>Test for &quot;length&quot; in test262 at

https://github.com/tc39/test262/blob/83b27c9beb7b3ea78b319148b5c82a5411a333b1/test/language/statements/function/13.2-15-1.js#L19</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1196383</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2016-05-25 10:51:57 -0700</bug_when>
    <thetext>This is already fixed in ToT.  You can verify this for yourself using Safari Technology Preview or a WebKit Nightly build (https://webkit.org/downloads/).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>