DescriptionIn Chrome 28.0.1480.0 canary (among other versions),
Object.freeze(Object.prototype) causes __proto__ to lose its magic,
which causes various internal code to fail; most critically,
Object.create(X) produces objects whose [[Prototype]] is
Object.prototype rather than X. Repair this by reimplementing
Object.create from scratch.
The repair cannot support Object.create(null); therefore, kludge
SES-only code into working despite its absence:
* StringMap.js is willing to use {} instead of Object.create(null); safe
because the keys are suffixed.
* Replace string-map uses of Object.create(null) in repairES5 with an
explicit (lightened) StringMap abstraction.
* sharedImports and scope objects will have Object.prototype's
properties as bindings.
* Loosen testProtoMention test to be willing for __proto__ as a global
variable to throw errors.
Also repair Error.prototype.toString whose native implementation is
also broken by lack of __proto__ magic.
Note that there is further fatal-to-Caja misbehavior in the same Chrome
versions, with apparently the same root cause, only if the "Enable
Experimental JavaScript" flag is on (symptom: {}.constructor === Symbol
(itself an experimental feature), rather than Object), and this repair
does not deal with that.
@r5359
Patch Set 1 #
Total comments: 4
Patch Set 2 : Repair Object.create misbehavior on Chrome. #Patch Set 3 : Repair Object.create on Chrome; make SES compatible with no Object.create(null). #
Total comments: 5
Patch Set 4 : Repair Object.create on Chrome; make SES compatible with no Object.create(null). #
MessagesTotal messages: 17
|
||||||||||||||||||||||||||||||||||||||||||||||