Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disallow line break between async and property #11947

Merged
merged 1 commit into from Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/babel-generator/src/generators/methods.js
Expand Up @@ -37,6 +37,8 @@ export function _methodHead(node: Object) {
}

if (node.async) {
// ensure `async` is in the same line with property name
this._catchUp("start", key.loc);
this.word("async");
this.space();
}
Expand Down
@@ -0,0 +1,4 @@
class Test {
@TestDecorator
async decorateMe() {}
}
@@ -0,0 +1,4 @@
{
"retainLines": true,
"plugins": [["decorators", { "decoratorsBeforeExport": true }]]
}
@@ -0,0 +1,3 @@
class Test {
@TestDecorator
async decorateMe() {}}