| Index: test/mjsunit/harmony/super.js
|
| diff --git a/test/mjsunit/harmony/super.js b/test/mjsunit/harmony/super.js
|
| index d972407520ecda11269608609d185b0cbbc38ca8..8221d3ad0d203cbb6782a0e32a83353c83f95749 100644
|
| --- a/test/mjsunit/harmony/super.js
|
| +++ b/test/mjsunit/harmony/super.js
|
| @@ -1861,3 +1861,51 @@ function Subclass(base, constructor) {
|
| T1.__proto = null;
|
| assertThrows(function() { new T1(); }, TypeError);
|
| }());
|
| +
|
| +
|
| +(function TestSuperCallSyntacticRestriction() {
|
| + assertThrows(function() {
|
| + function C() {
|
| + var y;
|
| + super();
|
| + }
|
| + new C();
|
| + }, TypeError);
|
| + assertThrows(function() {
|
| + function C() {
|
| + super(this.x);
|
| + }
|
| + new C();
|
| + }, TypeError);
|
| + assertThrows(function() {
|
| + function C() {
|
| + super(this);
|
| + }
|
| + new C();
|
| + }, TypeError);
|
| + assertThrows(function() {
|
| + function C() {
|
| + super(1, 2, Object.getPrototypeOf(this));
|
| + }
|
| + new C();
|
| + }, TypeError);
|
| +
|
| + function C1() {
|
| + 'use strict';
|
| + super();
|
| + };
|
| + new C1();
|
| +
|
| + function C2() {
|
| + ; 'use strict';;;;;
|
| + super();
|
| + };
|
| + new C2();
|
| +
|
| + function C3() {
|
| + ; 'use strict';;;;;
|
| + // This is a comment.
|
| + super();
|
| + }
|
| + new C3();
|
| +}());
|
|
|