archives

« Bugzilla Issues Index

#1613 — 8.3.16.10: step 7 can fail silently if non-configurable "prototype" already present


Step 7 of 8.3.16.10 (MakeConstructor) can fail silently if the `F` object already has a non-configurable "prototype" property. Maybe this is also place where DefinePropertyOrThrow() needs to be used, but I'm not 100% this time.

test case:
---
class MyFunction extends Function {
constructor(...args) {
Object.defineProperty(this, "prototype", {value: 0});
super(...args);
}
}

var fn = new MyFunction("");

print(fn.prototype); // prints 0
---


this should never occur. Added an appropriate assertion.

Fixed in rev17 editor's draft


fixed in rev17, August 23, 2013 draft