fix: disallow line break between async and property (#11947)
This commit is contained in:
parent
008fe25ae2
commit
3bff1ce35a
@ -37,6 +37,8 @@ export function _methodHead(node: Object) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (node.async) {
|
if (node.async) {
|
||||||
|
// ensure `async` is in the same line with property name
|
||||||
|
this._catchUp("start", key.loc);
|
||||||
this.word("async");
|
this.word("async");
|
||||||
this.space();
|
this.space();
|
||||||
}
|
}
|
||||||
|
|||||||
4
packages/babel-generator/test/fixtures/regression/11870/input.js
vendored
Normal file
4
packages/babel-generator/test/fixtures/regression/11870/input.js
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class Test {
|
||||||
|
@TestDecorator
|
||||||
|
async decorateMe() {}
|
||||||
|
}
|
||||||
4
packages/babel-generator/test/fixtures/regression/11870/options.json
vendored
Normal file
4
packages/babel-generator/test/fixtures/regression/11870/options.json
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"retainLines": true,
|
||||||
|
"plugins": [["decorators", { "decoratorsBeforeExport": true }]]
|
||||||
|
}
|
||||||
3
packages/babel-generator/test/fixtures/regression/11870/output.js
vendored
Normal file
3
packages/babel-generator/test/fixtures/regression/11870/output.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
class Test {
|
||||||
|
@TestDecorator
|
||||||
|
async decorateMe() {}}
|
||||||
Loading…
x
Reference in New Issue
Block a user