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

@@ -0,0 +1,12 @@
class Foo {
constructor() {
this.num = 1;
}
call constructor() {
return { num: 2 };
}
}
assert.equal(new Foo().num, 1);
assert.equal(Foo().num, 2);

View File

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

View File

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

View File

@@ -0,0 +1,16 @@
let _Foo = class Foo {};
var _FooCall = function () {
foo();
};
var Foo = function (...args) {
if (this instanceof Foo) {
return Reflect.construct(_Foo, args);
} else {
return _FooCall.apply(this, args);
}
};
Foo.__proto__ = _Foo;
Foo;

View File

@@ -0,0 +1,5 @@
export default class Foo {
call constructor() {
}
}

View File

@@ -0,0 +1,14 @@
let _Foo = class Foo {};
var _FooCall = function () {};
var Foo = function (...args) {
if (this instanceof Foo) {
return Reflect.construct(_Foo, args);
} else {
return _FooCall.apply(this, args);
}
};
Foo.__proto__ = _Foo;
export default Foo;

View File

@@ -0,0 +1,5 @@
(class {
call constructor() {
foo();
}
});

View File

@@ -0,0 +1,16 @@
let _class2 = class {};
var _classCall = function () {
foo();
};
var _class = function (...args) {
if (this instanceof _class) {
return Reflect.construct(_class2, args);
} else {
return _classCall.apply(this, args);
}
};
_class.__proto__ = _class2;
_class;

View File

@@ -0,0 +1,12 @@
let Foo = class {
constructor() {
this.num = 1;
}
call constructor() {
return { num: 2 };
}
};
assert.equal(new Foo().num, 1);
assert.equal(Foo().num, 2);

View File

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

View File

@@ -0,0 +1,5 @@
let Foo = class {
call constructor() {
foo();
}
};

View File

@@ -0,0 +1,18 @@
let Foo = (function () {
let _class2 = class {};
var _classCall = function () {
foo();
};
var _class = function (...args) {
if (this instanceof _class) {
return Reflect.construct(_class2, args);
} else {
return _classCall.apply(this, args);
}
};
_class.__proto__ = _class2;
return _class;
})();

View File

@@ -0,0 +1,3 @@
{
"plugins": ["transform-class-constructor-call"]
}