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
|
||||
description: >
|
||||
SuperProperty evaluation order: super() thisBinding initialization occurs first.
|
||||
SuperProperty evaluation order: super() thisBinding initialization must occur first.
|
||||
---*/
|
||||
class Derived extends Object {
|
||||
constructor() {
|
||||
super[super()];
|
||||
throw new Test262Error();
|
||||
}
|
||||
}
|
||||
|
||||
var derived = new Derived();
|
||||
assert.sameValue(derived instanceof Derived, true);
|
||||
assert.sameValue(derived instanceof Object, true);
|
||||
assert.throws(ReferenceError, function() {
|
||||
new Derived();
|
||||
}, '`super[super()]` via `new Derived()` throws a ReferenceError');
|
||||
|
|
Loading…
Reference in New Issue