<?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>49577</bug_id>
          
          <creation_ts>2010-11-15 21:51:25 -0800</creation_ts>
          <short_desc>Function.prototype should be non-configurable</short_desc>
          <delta_ts>2010-11-18 20:39:51 -0800</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>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Gavin Barraclough">barraclough</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ricow</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>309580</commentid>
    <comment_count>0</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2010-11-15 21:51:25 -0800</bug_when>
    <thetext>JSC lazily allocates the prototype property of Function objects.

We check the prototype exists on &apos;get&apos;, but not on &apos;put&apos;.
If you &apos;put&apos; without having first done a &apos;get&apos; you can end up with a configurable prototype (prototype should only ever be non-configurable).

This is visible in a couple of ways:
 * &apos;delete&apos; on the property may succeed. (the next access will result in a new, reset prototype object).
 * the prototype may be set to a getter.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>309604</commentid>
    <comment_count>1</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2010-11-15 23:28:11 -0800</bug_when>
    <thetext>fixed in http://trac.webkit.org/changeset/72063</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>310139</commentid>
    <comment_count>2</comment_count>
    <who name="Rico">ricow</who>
    <bug_when>2010-11-16 23:22:12 -0800</bug_when>
    <thetext>It seems that the change introduces a test that is not consistent with the specification.
The new test file:
LayoutTests/fast/js/script-tests/function-prototype-descriptor.js
Tests that the prototype property on a function is enumerable, which it should not be (see 15.3.5.2 and 13.2 step 18 in the spec).
This was also discussed on the V8 issue tracker:
http://code.google.com/p/v8/issues/detail?id=935

Please let me know if you disagree.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>311176</commentid>
    <comment_count>3</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2010-11-18 16:54:18 -0800</bug_when>
    <thetext>Hi Rico,

Yes, looks to me like you&apos;re right.  Should be a quick fix, will roll a patch for JSC &amp; update regression tests.

thanks,
G.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>311268</commentid>
    <comment_count>4</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2010-11-18 20:39:51 -0800</bug_when>
    <thetext>Many thanks for bringing this to our attention Rico, should be fixed in r72362.  Let me know if this doesn&apos;t resolve the issues for you.

cheers,
G.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>