[decorators] Support async and generator methods (#8742)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
@decorator
|
||||
class Foo {
|
||||
async f1() {}
|
||||
|
||||
*f2() {}
|
||||
|
||||
async *f3() {}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"plugins": [
|
||||
["proposal-decorators", { "decoratorsBeforeExport": false }],
|
||||
"proposal-class-properties",
|
||||
"syntax-async-generators",
|
||||
["external-helpers", { "helperVersion": "7.0.2" }]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
let Foo = babelHelpers.decorate([decorator], function (_initialize) {
|
||||
"use strict";
|
||||
|
||||
class Foo {
|
||||
constructor() {
|
||||
_initialize(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
F: Foo,
|
||||
d: [{
|
||||
kind: "method",
|
||||
key: "f1",
|
||||
|
||||
async value() {}
|
||||
|
||||
}, {
|
||||
kind: "method",
|
||||
key: "f2",
|
||||
|
||||
*value() {}
|
||||
|
||||
}, {
|
||||
kind: "method",
|
||||
key: "f3",
|
||||
|
||||
async *value() {}
|
||||
|
||||
}]
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user