diff --git a/test/language/statements/class/super/in-constructor-superproperty-evaluation.js b/test/language/statements/class/super/in-constructor-superproperty-evaluation.js new file mode 100644 index 0000000000000000000000000000000000000000..0bad2fb82a4639561535489ddcf9a458cfe28c03 --- /dev/null +++ b/test/language/statements/class/super/in-constructor-superproperty-evaluation.js @@ -0,0 +1,17 @@ +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-makesuperpropertyreference +description: > + SuperProperty evaluation order: super() thisBinding initialization must occur first. +---*/ +class Derived extends Object { + constructor() { + super[super()]; + throw new Test262Error(); + } +} + +assert.throws(ReferenceError, function() { + new Derived(); +}, '`super[super()]` via `new Derived()` throws a ReferenceError'); diff --git a/test/language/statements/class/super/in-constructor.js b/test/language/statements/class/super/in-constructor.js index 5601f1fec649316255909c9edde64b2b064cdd43..f22f47b3fa65622126026ad4e11c05f1077a06ec 100644 --- a/test/language/statements/class/super/in-constructor.js +++ b/test/language/statements/class/super/in-constructor.js @@ -1,7 +1,7 @@ // Copyright (C) 2014 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 14.5 +esid: sec-makesuperpropertyreference description: > class super in constructor ---*/ @@ -18,4 +18,4 @@ class C extends B { } new C; -assert.sameValue(calls, 1, "The value of `calls` is `1`"); \ No newline at end of file +assert.sameValue(calls, 1, "The value of `calls` is `1`"); diff --git a/test/language/statements/class/super/in-getter.js b/test/language/statements/class/super/in-getter.js index 4a54cd599365b0666e924f3bf0768d3b34f1155c..6e3a165b48039e8d5d984efca3ffcac203e7bd59 100644 --- a/test/language/statements/class/super/in-getter.js +++ b/test/language/statements/class/super/in-getter.js @@ -1,7 +1,7 @@ // Copyright (C) 2014 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 14.5 +esid: sec-makesuperpropertyreference description: > class super in getter ---*/ @@ -19,4 +19,4 @@ class C extends B { return super.method(); } } -assert.sameValue(new C().y, 1, "The value of `new C().y` is `1`"); \ No newline at end of file +assert.sameValue(new C().y, 1, "The value of `new C().y` is `1`"); diff --git a/test/language/statements/class/super/in-methods.js b/test/language/statements/class/super/in-methods.js index fa7246bac8ede0c3ebf155a7398ee592f6d4d5c4..54dd00fc2d97173ce57340ef83c8382f62004813 100644 --- a/test/language/statements/class/super/in-methods.js +++ b/test/language/statements/class/super/in-methods.js @@ -1,7 +1,7 @@ // Copyright (C) 2014 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 14.5 +esid: sec-makesuperpropertyreference description: > class super in methods ---*/ @@ -19,4 +19,4 @@ class C extends B { return super.method(); } } -assert.sameValue(new C().method(), 1, "`new C().method()` returns `1`"); \ No newline at end of file +assert.sameValue(new C().method(), 1, "`new C().method()` returns `1`"); diff --git a/test/language/statements/class/super/in-setter.js b/test/language/statements/class/super/in-setter.js index 118900ec0dfa6d272024751554f242d22992e4c3..a621c45471f3886035d3117f45d4f741df48210c 100644 --- a/test/language/statements/class/super/in-setter.js +++ b/test/language/statements/class/super/in-setter.js @@ -1,7 +1,7 @@ // Copyright (C) 2014 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 14.5 +esid: sec-makesuperpropertyreference description: > class super in setter ---*/ @@ -20,4 +20,4 @@ class C extends B { assert.sameValue(super.method(), 1, "`super.method()` returns `1`"); } } -assert.sameValue(new C().y = 3, 3, "`new C().y = 3` is `3`"); \ No newline at end of file +assert.sameValue(new C().y = 3, 3, "`new C().y = 3` is `3`"); diff --git a/test/language/statements/class/super/in-static-getter.js b/test/language/statements/class/super/in-static-getter.js index 33643fa8eeb94389587e2cbcda7e169b2e8908b8..05da99a9a3aa6f7389fc3908eda291cc590e4882 100644 --- a/test/language/statements/class/super/in-static-getter.js +++ b/test/language/statements/class/super/in-static-getter.js @@ -1,7 +1,7 @@ // Copyright (C) 2014 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 14.5 +esid: sec-makesuperpropertyreference description: > class super in static getter ---*/ @@ -19,4 +19,4 @@ class C extends B { return super.method(); } } -assert.sameValue(C.x, 1, "The value of `C.x` is `1`"); \ No newline at end of file +assert.sameValue(C.x, 1, "The value of `C.x` is `1`"); diff --git a/test/language/statements/class/super/in-static-methods.js b/test/language/statements/class/super/in-static-methods.js index 24d3ee146e891d28a208cd0f6cf58066d476f600..81b7d5992e208e4b460023814f7fd1e200bcf901 100644 --- a/test/language/statements/class/super/in-static-methods.js +++ b/test/language/statements/class/super/in-static-methods.js @@ -1,7 +1,7 @@ // Copyright (C) 2014 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 14.5 +esid: sec-makesuperpropertyreference description: > class super in static methods ---*/ @@ -19,4 +19,4 @@ class C extends B { return super.method(); } } -assert.sameValue(C.method(), 1, "`C.method()` returns `1`"); \ No newline at end of file +assert.sameValue(C.method(), 1, "`C.method()` returns `1`"); diff --git a/test/language/statements/class/super/in-static-setter.js b/test/language/statements/class/super/in-static-setter.js index 91b3ad0367dc1feee9d1bf118e48dd0c367c3909..1cbb933794a1a1b10aeed05cf4ade0c649e63bf7 100644 --- a/test/language/statements/class/super/in-static-setter.js +++ b/test/language/statements/class/super/in-static-setter.js @@ -1,7 +1,7 @@ // Copyright (C) 2014 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 14.5 +esid: sec-makesuperpropertyreference description: > class super in static setter ---*/ @@ -20,4 +20,4 @@ class C extends B { assert.sameValue(super.method(), 1, "`super.method()` returns `1`"); } } -assert.sameValue(C.x = 3, 3, "`C.x = 3` is `3`"); \ No newline at end of file +assert.sameValue(C.x = 3, 3, "`C.x = 3` is `3`");