add decorator tests
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
@foo
|
||||
class Foo {}
|
||||
|
||||
@foo
|
||||
@bar
|
||||
class Bar {}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"externalHelpers": true,
|
||||
"optional": ["es7.decorators"]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Foo {
|
||||
@bar
|
||||
get foo() {
|
||||
|
||||
}
|
||||
|
||||
@foo
|
||||
set foo(bar) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
}
|
||||
|
||||
babelHelpers.createDecoratedClass(Foo, [{
|
||||
key: "foo",
|
||||
decorators: [bar, foo],
|
||||
get: function () {},
|
||||
set: function (bar) {}
|
||||
}]);
|
||||
return Foo;
|
||||
})();
|
||||
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
@bar
|
||||
get foo() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
}
|
||||
|
||||
babelHelpers.createDecoratedClass(Foo, [{
|
||||
key: "foo",
|
||||
decorators: [bar],
|
||||
get: function () {}
|
||||
}]);
|
||||
return Foo;
|
||||
})();
|
||||
@@ -0,0 +1,4 @@
|
||||
class Foo {
|
||||
@bar
|
||||
foo = "Bar";
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = (function () {
|
||||
var _instanceInitializers = {};
|
||||
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
this.foo = _instanceInitializers.foo.call(this);
|
||||
}
|
||||
|
||||
babelHelpers.createDecoratedClass(Foo, [{
|
||||
key: "foo",
|
||||
enumerable: true,
|
||||
decorators: [bar],
|
||||
initializer: function () {
|
||||
return "Bar";
|
||||
}
|
||||
}], null, _instanceInitializers);
|
||||
return Foo;
|
||||
})();
|
||||
@@ -0,0 +1,4 @@
|
||||
class Foo {
|
||||
@bar
|
||||
static foo = "Bar";
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = (function () {
|
||||
var _staticInitializers = {};
|
||||
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
}
|
||||
|
||||
babelHelpers.createDecoratedClass(Foo, null, [{
|
||||
key: "foo",
|
||||
enumerable: true,
|
||||
decorators: [bar],
|
||||
initializer: function () {
|
||||
return "Bar";
|
||||
}
|
||||
}], null, _staticInitializers);
|
||||
Foo.foo = _staticInitializers.foo.call(Foo);
|
||||
return Foo;
|
||||
})();
|
||||
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
@bar
|
||||
foo() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
}
|
||||
|
||||
babelHelpers.createDecoratedClass(Foo, [{
|
||||
key: "foo",
|
||||
decorators: [bar],
|
||||
value: function foo() {}
|
||||
}]);
|
||||
return Foo;
|
||||
})();
|
||||
@@ -0,0 +1,4 @@
|
||||
class Foo {
|
||||
@bar
|
||||
foo;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = (function () {
|
||||
var _instanceInitializers = {};
|
||||
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
this.foo = _instanceInitializers.foo.call(this);
|
||||
}
|
||||
|
||||
babelHelpers.createDecoratedClass(Foo, [{
|
||||
key: "foo",
|
||||
enumerable: true,
|
||||
decorators: [bar],
|
||||
initializer: function () {}
|
||||
}], null, _instanceInitializers);
|
||||
return Foo;
|
||||
})();
|
||||
@@ -0,0 +1,4 @@
|
||||
class Foo {
|
||||
@bar
|
||||
static foo;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = (function () {
|
||||
var _staticInitializers = {};
|
||||
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
}
|
||||
|
||||
babelHelpers.createDecoratedClass(Foo, null, [{
|
||||
key: "foo",
|
||||
enumerable: true,
|
||||
decorators: [bar],
|
||||
initializer: function () {}
|
||||
}], null, _staticInitializers);
|
||||
Foo.foo = _staticInitializers.foo.call(Foo);
|
||||
return Foo;
|
||||
})();
|
||||
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
@bar
|
||||
set foo(arg) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
}
|
||||
|
||||
babelHelpers.createDecoratedClass(Foo, [{
|
||||
key: "foo",
|
||||
decorators: [bar],
|
||||
set: function (arg) {}
|
||||
}]);
|
||||
return Foo;
|
||||
})();
|
||||
@@ -0,0 +1,14 @@
|
||||
@foo
|
||||
class Foo {}
|
||||
|
||||
@foo
|
||||
@bar
|
||||
class Bar {}
|
||||
|
||||
var Foo2 = @bar class Foo {
|
||||
|
||||
};
|
||||
|
||||
var Bar2 = @foo @bar class Bar {
|
||||
|
||||
};
|
||||
@@ -18,3 +18,22 @@ var Bar = (function () {
|
||||
Bar = bar(Bar) || Bar;
|
||||
return Bar;
|
||||
})();
|
||||
|
||||
var Foo2 = (function () {
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
}
|
||||
|
||||
Foo = bar(Foo) || Foo;
|
||||
return Foo;
|
||||
})();
|
||||
|
||||
var Bar2 = (function () {
|
||||
function Bar() {
|
||||
babelHelpers.classCallCheck(this, Bar);
|
||||
}
|
||||
|
||||
Bar = foo(Bar) || Bar;
|
||||
Bar = bar(Bar) || Bar;
|
||||
return Bar;
|
||||
})();
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"externalHelpers": true,
|
||||
"optional": ["es7.decorators", "es7.classProperties"]
|
||||
}
|
||||
Reference in New Issue
Block a user