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 10, 2018
1 parent 1c3bf71 commit b66722a
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 b66722a

Please sign in to comment.