<?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>141610</bug_id>
          
          <creation_ts>2015-02-14 12:25:33 -0800</creation_ts>
          <short_desc>For many X, X.prototype is an X when it must be a plain object</short_desc>
          <delta_ts>2020-09-09 16:18:46 -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>420+</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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>
          <dependson>152574</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark S. Miller">erights</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andy</cc>
    
    <cc>ashvayka</cc>
    
    <cc>erights</cc>
    
    <cc>ggaren</cc>
    
    <cc>joepeck</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1069237</commentid>
    <comment_count>0</comment_count>
    <who name="Mark S. Miller">erights</who>
    <bug_when>2015-02-14 12:25:33 -0800</bug_when>
    <thetext>For example, ES6 specifies that Number.prototype should be a plain object, but it is currently an exotic Number object. 

This is especially problematic for Date, as it opens a potential global communications channel that can only be plugged expensively. See https://code.google.com/p/google-caja/issues/detail?id=1362</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1069608</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-02-16 15:04:34 -0800</bug_when>
    <thetext>&lt;rdar://problem/19852587&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1151389</commentid>
    <comment_count>2</comment_count>
    <who name="Andy VanWagoner">andy</who>
    <bug_when>2015-12-26 18:59:44 -0800</bug_when>
    <thetext>These are the prototypes I identified that should be plain objects, but are currently instances of their type:

- Boolean
- Date
- Error
- Number
- RegExp
- String

Are there any others?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1151392</commentid>
    <comment_count>3</comment_count>
    <who name="Mark S. Miller">erights</who>
    <bug_when>2015-12-26 19:23:39 -0800</bug_when>
    <thetext>IIRC, according to more recent tc39 decisions, Boolean, Number, and String are no longer included. They join Function and Array. This leaves Date, Error, and RegExp. Error doesn&apos;t really matter. Date and RegExp are important, in order to plug a global communications channel.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1151418</commentid>
    <comment_count>4</comment_count>
    <who name="Andy VanWagoner">andy</who>
    <bug_when>2015-12-27 10:07:11 -0800</bug_when>
    <thetext>Ok. My first naive pass at making this change resulted in breaking everything. (&gt; 1000 tests) :) I&apos;ll see if reverting Boolean, Number, and String make it more manageable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1687190</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2020-09-09 16:18:46 -0700</bug_when>
    <thetext>(In reply to Mark S. Miller from comment #3)
&gt; IIRC, according to more recent tc39 decisions, Boolean, Number, and String
&gt; are no longer included. They join Function and Array. This leaves Date,
&gt; Error, and RegExp. Error doesn&apos;t really matter. Date and RegExp are
&gt; important, in order to plug a global communications channel.

Thank you for filing this and the follow-up!

r194636 fixed Date.prototype.
r198469 fixed Error.prototype.
r198447 fixed RegExp.prototype.

test262 coverage is being added in https://github.com/tc39/test262/pull/2760.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>