mirror of https://github.com/tc39/test262.git
SuperProperty evaluation order, must first call super()
- Invalid: super[super()]. Expects super() to be called prior to super property access.
This commit is contained in:
parent
85a4484c52
commit
ecea13b04a
|
@ -3,14 +3,15 @@
|
||||||
/*---
|
/*---
|
||||||
esid: sec-makesuperpropertyreference
|
esid: sec-makesuperpropertyreference
|
||||||
description: >
|
description: >
|
||||||
SuperProperty evaluation order: super() thisBinding initialization occurs first.
|
SuperProperty evaluation order: super() thisBinding initialization must occur first.
|
||||||
---*/
|
---*/
|
||||||
class Derived extends Object {
|
class Derived extends Object {
|
||||||
constructor() {
|
constructor() {
|
||||||
super[super()];
|
super[super()];
|
||||||
|
throw new Test262Error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var derived = new Derived();
|
assert.throws(ReferenceError, function() {
|
||||||
assert.sameValue(derived instanceof Derived, true);
|
new Derived();
|
||||||
assert.sameValue(derived instanceof Object, true);
|
}, '`super[super()]` via `new Derived()` throws a ReferenceError');
|
||||||
|
|
Loading…
Reference in New Issue