Skip to content

Commit

Permalink
Add test for yield/await in class decorators
Browse files Browse the repository at this point in the history
NOTE: This doesn't work for decorators inside the class body, like in
      babel#8300
  • Loading branch information
nicolo-ribaudo committed Jul 28, 2018
1 parent 994b9f1 commit 07e2e82
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
async function* f() {
@(yield dec1)
@(await dec2)
class A {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["proposal-decorators", "proposal-class-properties", "external-helpers", "syntax-async-generators"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
async function* f() {
let A = babelHelpers.decorate([yield dec1, await dec2], function (_initialize) {
"use strict";

class A {
constructor() {
_initialize(this);
}

}

return {
F: A,
d: []
};
});
}

0 comments on commit 07e2e82

Please sign in to comment.