Skip to content
Snippets Groups Projects
Commit ecea13b0 authored by Rick Waldron's avatar Rick Waldron
Browse files

SuperProperty evaluation order, must first call super()

- Invalid: super[super()]. Expects super() to be called prior to super property access.
parent 85a4484c
No related branches found
No related tags found
No related merge requests found
......@@ -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');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment