move all plugin tests out of babel-core and into their appropriate folders

This commit is contained in:
Sebastian McKenzie
2015-11-08 23:04:10 -08:00
parent 5f40b53dee
commit 15969a0904
1189 changed files with 365 additions and 65 deletions

View File

@@ -18,5 +18,8 @@
},
"keywords": [
"babel-plugin"
]
],
"devDependencies": {
"babel-helper-plugin-test-runner": "^6.0.0"
}
}

View File

@@ -0,0 +1,9 @@
class Foo {
bar() {
return Foo;
}
}
var Bar = Foo;
Foo = 5;
assert.equal((new Bar).bar(), Bar);

View File

@@ -0,0 +1,9 @@
var Foo = class Foo {
bar() {
return Foo;
}
}
var Bar = Foo;
Foo = 5;
assert.equal((new Bar).bar(), Bar);

View File

@@ -0,0 +1,3 @@
{
"plugins": ["transform-es2015-classes", "transform-es2015-block-scoping"]
}

View File

@@ -0,0 +1,11 @@
class Foo {
bar() {
return Foo;
}
}
var Bar = Foo;
Foo = 5;
assert.throws(function () {
Bar.call(6);
}, /Cannot call a class as a function/);

View File

@@ -0,0 +1,10 @@
function build(val) {
return class {
[this.key]() {
return val;
}
};
}
var Class = build.call({ key: "foo" }, "bar");
assert.equal(new Class().foo(), "bar");

View File

@@ -0,0 +1,21 @@
var log = '';
class Base {
p() { log += '[Base]'; }
}
class OtherBase {
p() { log += '[OtherBase]'; }
}
class Derived extends Base {
p() {
log += '[Derived]';
super.p();
Derived.prototype.__proto__ = OtherBase.prototype;
super.p();
}
}
new Derived().p();
assert.equal(log, '[Derived][Base][OtherBase]');

View File

@@ -0,0 +1,14 @@
class Foo {
constructor() {
return { i: 1 };
}
}
class Bar extends Foo {
constructor() {
assert.equal(super().i, 1);
assert.equal(this.i, 1);
}
}
new Bar;

View File

@@ -0,0 +1,13 @@
class Test extends Foo {
constructor() {
woops.super.test();
super();
super.test();
super(...arguments);
super("test", ...arguments);
super.test(...arguments);
super.test("test", ...arguments);
}
}

View File

@@ -0,0 +1,25 @@
var Test = (function (_Foo) {
babelHelpers.inherits(Test, _Foo);
function Test() {
var _Foo$prototype$test, _Foo$prototype$test2;
babelHelpers.classCallCheck(this, Test);
woops.super.test();
var _this = babelHelpers.possibleConstructorReturn(this, _Foo.call(this));
_Foo.prototype.test.call(_this);
var _this = babelHelpers.possibleConstructorReturn(this, _Foo.apply(this, arguments));
var _this = babelHelpers.possibleConstructorReturn(this, _Foo.call.apply(_Foo, [this, "test"].concat(Array.prototype.slice.call(arguments))));
(_Foo$prototype$test = _Foo.prototype.test).call.apply(_Foo$prototype$test, [_this].concat(Array.prototype.slice.call(arguments)));
(_Foo$prototype$test2 = _Foo.prototype.test).call.apply(_Foo$prototype$test2, [_this, "test"].concat(Array.prototype.slice.call(arguments)));
return _this;
}
return Test;
})(Foo);

View File

@@ -0,0 +1,7 @@
class Test extends Foo {
constructor() {
super();
super.test;
super.test.whatever;
}
}

View File

@@ -0,0 +1,15 @@
var Test = (function (_Foo) {
babelHelpers.inherits(Test, _Foo);
function Test() {
babelHelpers.classCallCheck(this, Test);
var _this = babelHelpers.possibleConstructorReturn(this, _Foo.call(this));
_Foo.prototype.test;
_Foo.prototype.test.whatever;
return _this;
}
return Test;
})(Foo);

View File

@@ -0,0 +1,11 @@
class Test extends Foo {
constructor() {
super();
super.test.whatever();
super.test();
}
static test() {
return super.wow();
}
}

View File

@@ -0,0 +1,19 @@
var Test = (function (_Foo) {
babelHelpers.inherits(Test, _Foo);
function Test() {
babelHelpers.classCallCheck(this, Test);
var _this = babelHelpers.possibleConstructorReturn(this, _Foo.call(this));
_Foo.prototype.test.whatever();
_Foo.prototype.test.call(_this);
return _this;
}
Test.test = function test() {
return _Foo.wow.call(this);
};
return Test;
})(Foo);

View File

@@ -0,0 +1,13 @@
class x {
f() {
1
2
3
}
constructor() {
4
5
6
}
}

View File

@@ -0,0 +1,17 @@
var x = (function () {
x.prototype.f = function f() {
1;
2;
3;
};
function x() {
babelHelpers.classCallCheck(this, x);
4;
5;
6;
}
return x;
})();

View File

@@ -0,0 +1,5 @@
class Foo {
"bar"() {
}
}

View File

@@ -0,0 +1,9 @@
var Foo = (function () {
function Foo() {
babelHelpers.classCallCheck(this, Foo);
}
Foo.prototype["bar"] = function bar() {};
return Foo;
})();

View File

@@ -0,0 +1,3 @@
{
"plugins": ["external-helpers-2", "transform-es2015-function-name", ["transform-es2015-classes", { "loose": true }], "transform-es2015-spread", "transform-es2015-block-scoping"]
}

View File

@@ -0,0 +1,7 @@
class BaseController extends Chaplin.Controller {
}
class BaseController2 extends Chaplin.Controller.Another {
}

View File

@@ -0,0 +1,21 @@
var BaseController = (function (_Chaplin$Controller) {
babelHelpers.inherits(BaseController, _Chaplin$Controller);
function BaseController() {
babelHelpers.classCallCheck(this, BaseController);
return babelHelpers.possibleConstructorReturn(this, _Chaplin$Controller.apply(this, arguments));
}
return BaseController;
})(Chaplin.Controller);
var BaseController2 = (function (_Chaplin$Controller$A) {
babelHelpers.inherits(BaseController2, _Chaplin$Controller$A);
function BaseController2() {
babelHelpers.classCallCheck(this, BaseController2);
return babelHelpers.possibleConstructorReturn(this, _Chaplin$Controller$A.apply(this, arguments));
}
return BaseController2;
})(Chaplin.Controller.Another);

View File

@@ -0,0 +1 @@
class Test extends Foo { }

View File

@@ -0,0 +1,10 @@
var Test = (function (_Foo) {
babelHelpers.inherits(Test, _Foo);
function Test() {
babelHelpers.classCallCheck(this, Test);
return babelHelpers.possibleConstructorReturn(this, _Foo.apply(this, arguments));
}
return Test;
})(Foo);

View File

@@ -0,0 +1,5 @@
class Test {
constructor() {
super.hasOwnProperty("test");
}
}

View File

@@ -0,0 +1,5 @@
var Test = function Test() {
babelHelpers.classCallCheck(this, Test);
Function.prototype.hasOwnProperty.call(this, "test");
};

View File

@@ -0,0 +1,25 @@
class Test extends Foo {
constructor() {
woops.super.test();
super();
super.test();
super(...arguments);
super("test", ...arguments);
super.test(...arguments);
super.test("test", ...arguments);
}
test() {
super.test();
super.test(...arguments);
super.test("test", ...arguments);
}
static foo() {
super.foo();
super.foo(...arguments);
super.foo("test", ...arguments);
}
}

View File

@@ -0,0 +1,46 @@
var _Object$getPrototypeO;
var Test = (function (_Foo) {
babelHelpers.inherits(Test, _Foo);
function Test() {
var _babelHelpers$get;
babelHelpers.classCallCheck(this, Test);
woops.super.test();
var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Test).call(this));
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", _this).call(_this);
var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Test).apply(this, arguments));
var _this = babelHelpers.possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Test)).call.apply(_Object$getPrototypeO, [this, "test"].concat(Array.prototype.slice.call(arguments))));
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", _this).apply(_this, arguments);
(_babelHelpers$get = babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", _this)).call.apply(_babelHelpers$get, [_this, "test"].concat(Array.prototype.slice.call(arguments)));
return _this;
}
babelHelpers.createClass(Test, [{
key: "test",
value: function test() {
var _babelHelpers$get2;
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", this).call(this);
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", this).apply(this, arguments);
(_babelHelpers$get2 = babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", this)).call.apply(_babelHelpers$get2, [this, "test"].concat(Array.prototype.slice.call(arguments)));
}
}], [{
key: "foo",
value: function foo() {
var _babelHelpers$get3;
babelHelpers.get(Object.getPrototypeOf(Test), "foo", this).call(this);
babelHelpers.get(Object.getPrototypeOf(Test), "foo", this).apply(this, arguments);
(_babelHelpers$get3 = babelHelpers.get(Object.getPrototypeOf(Test), "foo", this)).call.apply(_babelHelpers$get3, [this, "test"].concat(Array.prototype.slice.call(arguments)));
}
}]);
return Test;
})(Foo);

View File

@@ -0,0 +1,7 @@
class Test extends Foo {
constructor() {
super();
super.test;
super.test.whatever;
}
}

View File

@@ -0,0 +1,15 @@
var Test = (function (_Foo) {
babelHelpers.inherits(Test, _Foo);
function Test() {
babelHelpers.classCallCheck(this, Test);
var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Test).call(this));
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", _this);
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", _this).whatever;
return _this;
}
return Test;
})(Foo);

View File

@@ -0,0 +1,11 @@
class Test extends Foo {
constructor() {
super();
super.test.whatever();
super.test();
}
static test() {
return super.wow();
}
}

View File

@@ -0,0 +1,21 @@
var Test = (function (_Foo) {
babelHelpers.inherits(Test, _Foo);
function Test() {
babelHelpers.classCallCheck(this, Test);
var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Test).call(this));
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", _this).whatever();
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", _this).call(_this);
return _this;
}
babelHelpers.createClass(Test, null, [{
key: "test",
value: function test() {
return babelHelpers.get(Object.getPrototypeOf(Test), "wow", this).call(this);
}
}]);
return Test;
})(Foo);

View File

@@ -0,0 +1,6 @@
class Foo {
foo() {}
"foo"() {}
[bar]() {}
[bar + "foo"]() {}
}

View File

@@ -0,0 +1,17 @@
const sym = Symbol();
class Foo {
[sym] () {
return 1;
}
}
class Bar extends Foo {
[sym] () {
return super[sym]() + 2;
}
}
let i = new Bar();
assert.equal(i[sym](), 3);

View File

@@ -0,0 +1,20 @@
var Foo = (function () {
function Foo() {
babelHelpers.classCallCheck(this, Foo);
}
babelHelpers.createClass(Foo, [{
key: "foo",
value: function foo() {}
}, {
key: "foo",
value: function foo() {}
}, {
key: bar,
value: function value() {}
}, {
key: bar + "foo",
value: function value() {}
}]);
return Foo;
})();

View File

@@ -0,0 +1,7 @@
class Example {
constructor() {
var Example;
}
}
var t = new Example();

View File

@@ -0,0 +1,7 @@
var Example = function Example() {
babelHelpers.classCallCheck(this, Example);
var _Example;
};
var t = new Example();

View File

@@ -0,0 +1,21 @@
class Test {
constructor() {
this.state = "test";
}
}
class Foo extends Bar {
constructor() {
super();
this.state = "test";
}
}
class ConstructorScoping {
constructor(){
let bar;
{
let bar;
}
}
}

View File

@@ -0,0 +1,29 @@
var Test = function Test() {
babelHelpers.classCallCheck(this, Test);
this.state = "test";
};
var Foo = (function (_Bar) {
babelHelpers.inherits(Foo, _Bar);
function Foo() {
babelHelpers.classCallCheck(this, Foo);
var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Foo).call(this));
_this.state = "test";
return _this;
}
return Foo;
})(Bar);
var ConstructorScoping = function ConstructorScoping() {
babelHelpers.classCallCheck(this, ConstructorScoping);
var bar = undefined;
{
var _bar = undefined;
}
};

View File

@@ -0,0 +1,7 @@
class Foo extends Bar {
constructor() {
super(() => {
this.test;
});
}
}

View File

@@ -0,0 +1,14 @@
var Foo = (function (_Bar) {
babelHelpers.inherits(Foo, _Bar);
function Foo() {
var _this;
babelHelpers.classCallCheck(this, Foo);
return _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Foo).call(this, () => {
_this.test;
}));
}
return Foo;
})(Bar);

View File

@@ -0,0 +1,5 @@
class Foo extends Bar {
constructor() {
}
}

View File

@@ -0,0 +1,9 @@
var Foo = (function (_Bar) {
babelHelpers.inherits(Foo, _Bar);
function Foo() {
babelHelpers.classCallCheck(this, Foo);
}
return Foo;
})(Bar);

View File

@@ -0,0 +1,3 @@
{
"throws": "missing super() call in constructor"
}

View File

@@ -0,0 +1 @@
export default class extends A {}

View File

@@ -0,0 +1,12 @@
var _class = (function (_A) {
babelHelpers.inherits(_class, _A);
function _class() {
babelHelpers.classCallCheck(this, _class);
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(_class).apply(this, arguments));
}
return _class;
})(A);
export default _class;

View File

@@ -0,0 +1 @@
var o = { foo: class foo {} };

View File

@@ -0,0 +1,3 @@
var o = { foo: function foo() {
babelHelpers.classCallCheck(this, foo);
} };

View File

@@ -0,0 +1,8 @@
class Test {
get test() {
return 5 + 5;
}
set test(val) {
this._test = val;
}
}

View File

@@ -0,0 +1,16 @@
var Test = (function () {
function Test() {
babelHelpers.classCallCheck(this, Test);
}
babelHelpers.createClass(Test, [{
key: "test",
get: function get() {
return 5 + 5;
},
set: function set(val) {
this._test = val;
}
}]);
return Test;
})();

View File

@@ -0,0 +1,5 @@
class Test {
get test() {
return 5 + 5;
}
}

View File

@@ -0,0 +1,13 @@
var Test = (function () {
function Test() {
babelHelpers.classCallCheck(this, Test);
}
babelHelpers.createClass(Test, [{
key: "test",
get: function get() {
return 5 + 5;
}
}]);
return Test;
})();

View File

@@ -0,0 +1,5 @@
class Test {
test() {
return 5 + 5;
}
}

View File

@@ -0,0 +1,13 @@
var Test = (function () {
function Test() {
babelHelpers.classCallCheck(this, Test);
}
babelHelpers.createClass(Test, [{
key: "test",
value: function test() {
return 5 + 5;
}
}]);
return Test;
})();

View File

@@ -0,0 +1,5 @@
class Test {
set test(val) {
this._test = val;
}
}

View File

@@ -0,0 +1,13 @@
var Test = (function () {
function Test() {
babelHelpers.classCallCheck(this, Test);
}
babelHelpers.createClass(Test, [{
key: "test",
set: function set(val) {
this._test = val;
}
}]);
return Test;
})();

View File

@@ -0,0 +1,7 @@
import { a } from "./a";
class Foo {
_a() {
a();
}
}

View File

@@ -0,0 +1,17 @@
"use strict";
var _a2 = require("./a");
var Foo = (function () {
function Foo() {
babelHelpers.classCallCheck(this, Foo);
}
babelHelpers.createClass(Foo, [{
key: "_a",
value: function _a() {
(0, _a2.a)();
}
}]);
return Foo;
})();

View File

@@ -0,0 +1,3 @@
{
"plugins": ["external-helpers-2", "transform-es2015-function-name", "transform-es2015-classes", "transform-es2015-spread", "transform-es2015-block-scoping", "transform-es2015-modules-commonjs"]
}

View File

@@ -0,0 +1,3 @@
{
"plugins": ["external-helpers-2", "transform-es2015-function-name", "transform-es2015-classes", "transform-es2015-spread", "transform-es2015-block-scoping"]
}

View File

@@ -0,0 +1 @@
class Test { }

View File

@@ -0,0 +1,3 @@
var Test = function Test() {
babelHelpers.classCallCheck(this, Test);
};

View File

@@ -0,0 +1,22 @@
class MyCtrl {
constructor(a) {
"any directive prologue";
foo;
}
}
class MyCtrl2 {
constructor(a) {
"a";
"b";
foo;
}
}
class MyCtrl3 {
constructor(a) {
"a";
foo;
"b";
}
}

View File

@@ -0,0 +1,22 @@
var MyCtrl = function MyCtrl(a) {
"any directive prologue";
babelHelpers.classCallCheck(this, MyCtrl);
foo;
};
var MyCtrl2 = function MyCtrl2(a) {
"a";
"b";
babelHelpers.classCallCheck(this, MyCtrl2);
foo;
};
var MyCtrl3 = function MyCtrl3(a) {
"a";
babelHelpers.classCallCheck(this, MyCtrl3);
foo;
"b";
};

View File

@@ -0,0 +1,6 @@
// #1649
class Foo {
[Symbol()]() {}
[Symbol()]() {}
}

View File

@@ -0,0 +1,16 @@
// #1649
var Foo = (function () {
function Foo() {
babelHelpers.classCallCheck(this, Foo);
}
babelHelpers.createClass(Foo, [{
key: Symbol(),
value: function value() {}
}, {
key: Symbol(),
value: function value() {}
}]);
return Foo;
})();

View File

@@ -0,0 +1,26 @@
class Foo {
constructor() {
return { x: 1 };
}
}
assert.equal(new Foo().x, 1);
class Bar extends Foo {
constructor() {
super();
return;
}
}
assert.equal(new Bar().x, 1);
class Bar2 extends Foo {
constructor() {
super();
assert.equal(this.x, 1);
return { x: 2 };
}
}
assert.equal(new Bar2().x, 2);

View File

@@ -0,0 +1,17 @@
var BaseView = class BaseView {
constructor() {
this.autoRender = true;
}
}
var BaseView = class {
constructor() {
this.autoRender = true;
}
}
var BaseView = class {
foo() {
this.autoRender = true;
}
}

View File

@@ -0,0 +1,25 @@
var BaseView = function BaseView() {
babelHelpers.classCallCheck(this, BaseView);
this.autoRender = true;
};
var BaseView = function BaseView() {
babelHelpers.classCallCheck(this, BaseView);
this.autoRender = true;
};
var BaseView = (function () {
function BaseView() {
babelHelpers.classCallCheck(this, BaseView);
}
babelHelpers.createClass(BaseView, [{
key: "foo",
value: function foo() {
this.autoRender = true;
}
}]);
return BaseView;
})();

View File

@@ -0,0 +1,13 @@
class A {
static a() {
}
static get b(){
}
static set b(b){
}
}

View File

@@ -0,0 +1,15 @@
var A = (function () {
function A() {
babelHelpers.classCallCheck(this, A);
}
babelHelpers.createClass(A, null, [{
key: "a",
value: function a() {}
}, {
key: "b",
get: function get() {},
set: function set(b) {}
}]);
return A;
})();

View File

@@ -0,0 +1,5 @@
class Foo {
constructor() {
super();
}
}

View File

@@ -0,0 +1,5 @@
var Foo = function Foo() {
babelHelpers.classCallCheck(this, Foo);
Object.getPrototypeOf(Foo).call(this);
};

View File

@@ -0,0 +1,3 @@
{
"throws": "super() is only allowed in a derived constructor"
}

View File

@@ -0,0 +1,19 @@
class TestEmpty extends (class {}) {
}
class TestConstructorOnly extends (class { constructor() {} }) {
}
class TestMethodOnly extends (class { method() {} }) {
}
class TestConstructorAndMethod extends (class {
constructor() {}
method() {}
}) {
}
class TestMultipleMethods extends (class {
m1() {}
m2() {}
}) {}

View File

@@ -0,0 +1,99 @@
var TestEmpty = (function (_ref) {
babelHelpers.inherits(TestEmpty, _ref);
function TestEmpty() {
babelHelpers.classCallCheck(this, TestEmpty);
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TestEmpty).apply(this, arguments));
}
return TestEmpty;
})((function () {
function _class() {
babelHelpers.classCallCheck(this, _class);
}
return _class;
})());
var TestConstructorOnly = (function (_ref2) {
babelHelpers.inherits(TestConstructorOnly, _ref2);
function TestConstructorOnly() {
babelHelpers.classCallCheck(this, TestConstructorOnly);
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TestConstructorOnly).apply(this, arguments));
}
return TestConstructorOnly;
})((function () {
function _class2() {
babelHelpers.classCallCheck(this, _class2);
}
return _class2;
})());
var TestMethodOnly = (function (_ref3) {
babelHelpers.inherits(TestMethodOnly, _ref3);
function TestMethodOnly() {
babelHelpers.classCallCheck(this, TestMethodOnly);
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TestMethodOnly).apply(this, arguments));
}
return TestMethodOnly;
})((function () {
function _class3() {
babelHelpers.classCallCheck(this, _class3);
}
babelHelpers.createClass(_class3, [{
key: "method",
value: function method() {}
}]);
return _class3;
})());
var TestConstructorAndMethod = (function (_ref4) {
babelHelpers.inherits(TestConstructorAndMethod, _ref4);
function TestConstructorAndMethod() {
babelHelpers.classCallCheck(this, TestConstructorAndMethod);
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TestConstructorAndMethod).apply(this, arguments));
}
return TestConstructorAndMethod;
})((function () {
function _class4() {
babelHelpers.classCallCheck(this, _class4);
}
babelHelpers.createClass(_class4, [{
key: "method",
value: function method() {}
}]);
return _class4;
})());
var TestMultipleMethods = (function (_ref5) {
babelHelpers.inherits(TestMultipleMethods, _ref5);
function TestMultipleMethods() {
babelHelpers.classCallCheck(this, TestMultipleMethods);
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TestMultipleMethods).apply(this, arguments));
}
return TestMultipleMethods;
})((function () {
function _class5() {
babelHelpers.classCallCheck(this, _class5);
}
babelHelpers.createClass(_class5, [{
key: "m1",
value: function m1() {}
}, {
key: "m2",
value: function m2() {}
}]);
return _class5;
})());

View File

@@ -0,0 +1,7 @@
class BaseController extends Chaplin.Controller {
}
class BaseController2 extends Chaplin.Controller.Another {
}

View File

@@ -0,0 +1,21 @@
var BaseController = (function (_Chaplin$Controller) {
babelHelpers.inherits(BaseController, _Chaplin$Controller);
function BaseController() {
babelHelpers.classCallCheck(this, BaseController);
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(BaseController).apply(this, arguments));
}
return BaseController;
})(Chaplin.Controller);
var BaseController2 = (function (_Chaplin$Controller$A) {
babelHelpers.inherits(BaseController2, _Chaplin$Controller$A);
function BaseController2() {
babelHelpers.classCallCheck(this, BaseController2);
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(BaseController2).apply(this, arguments));
}
return BaseController2;
})(Chaplin.Controller.Another);

View File

@@ -0,0 +1 @@
class Test extends Foo { }

View File

@@ -0,0 +1,10 @@
var Test = (function (_Foo) {
babelHelpers.inherits(Test, _Foo);
function Test() {
babelHelpers.classCallCheck(this, Test);
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Test).apply(this, arguments));
}
return Test;
})(Foo);

View File

@@ -0,0 +1,5 @@
class Test {
constructor() {
super.hasOwnProperty("test");
}
}

View File

@@ -0,0 +1,5 @@
var Test = function Test() {
babelHelpers.classCallCheck(this, Test);
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "hasOwnProperty", this).call(this, "test");
};

View File

@@ -0,0 +1,5 @@
class Test {
foo() {
super();
}
}

View File

@@ -0,0 +1,3 @@
{
"throws": "super() outside of class constructor"
}

View File

@@ -0,0 +1,6 @@
class Foo extends Bar {
constructor() {
super.foo();
super();
}
}

View File

@@ -0,0 +1,3 @@
{
"throws": "'super.*' is not allowed before super()"
}

View File

@@ -0,0 +1,5 @@
class Foo extends Bar {
constructor() {
super(this);
}
}

View File

@@ -0,0 +1,3 @@
{
"throws": "'this' is not allowed before super()"
}

View File

@@ -0,0 +1,6 @@
class Foo extends Bar {
constructor() {
this.foo = "bar";
super();
}
}

View File

@@ -0,0 +1,3 @@
{
"throws": "'this' is not allowed before super()"
}

View File

@@ -0,0 +1 @@
require("babel-helper-plugin-test-runner")(__dirname);