Bug 141610
Summary: | For many X, X.prototype is an X when it must be a plain object | ||
---|---|---|---|
Product: | WebKit | Reporter: | Mark S. Miller <erights> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | andy, ashvayka, erights, ggaren, joepeck, webkit-bug-importer, ysuzuki |
Priority: | P2 | Keywords: | InRadar |
Version: | 420+ | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | 152574 | ||
Bug Blocks: |
Mark S. Miller
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/19852587>
Andy VanWagoner
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
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
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
(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.