RESOLVED FIXED 141610
For many X, X.prototype is an X when it must be a plain object
https://bugs.webkit.org/show_bug.cgi?id=141610
Summary For many X, X.prototype is an X when it must be a plain object
Mark S. Miller
Reported 2015-02-14 12:25:33 PST
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
Attachments
Radar WebKit Bug Importer
Comment 1 2015-02-16 15:04:34 PST
Andy VanWagoner
Comment 2 2015-12-26 18:59:44 PST
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?
Mark S. Miller
Comment 3 2015-12-26 19:23:39 PST
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't really matter. Date and RegExp are important, in order to plug a global communications channel.
Andy VanWagoner
Comment 4 2015-12-27 10:07:11 PST
Ok. My first naive pass at making this change resulted in breaking everything. (> 1000 tests) :) I'll see if reverting Boolean, Number, and String make it more manageable.
Alexey Shvayka
Comment 5 2020-09-09 16:18:46 PDT
(In reply to Mark S. Miller from comment #3) > 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't really matter. Date and RegExp are > 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.
Note You need to log in before you can comment on or make changes to this bug.