Replace superIdentifier with superProperty.

This also disallows the usage of bare `super` that is not part of a
member expression, call expression, or new expression.
This commit is contained in:
Brian Donovan
2015-01-08 08:36:16 -08:00
parent 324a4a1b22
commit 5b4d6d7ba9
5 changed files with 45 additions and 101 deletions

View File

@@ -3,7 +3,6 @@ class Test extends Foo {
woops.super.test();
super();
super.test();
foob(super);
super(...arguments);
super("test", ...arguments);

View File

@@ -45,7 +45,6 @@ var Test = (function () {
woops["super"].test();
_get(Object.getPrototypeOf(Test.prototype), "constructor", this).call(this);
_get(Object.getPrototypeOf(Test.prototype), "test", this).call(this);
foob(_Foo);
(_get2 = _get(Object.getPrototypeOf(Test.prototype), "constructor", this)).call.apply(_get2, [this].concat(_slice.call(arguments)));
(_get3 = _get(Object.getPrototypeOf(Test.prototype), "constructor", this)).call.apply(_get3, [this, "test"].concat(_slice.call(arguments)));

View File

@@ -0,0 +1,5 @@
class Test {
constructor() {
console.log(super);
}
}

View File

@@ -0,0 +1,3 @@
{
"throws": "illegal use of bare super"
}