Skip to content

Commit

Permalink
use this.ensureNoLineTerminator
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Sep 29, 2022
1 parent 9dfae22 commit 160b1f2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/babel-generator/src/generators/expressions.ts
Expand Up @@ -350,14 +350,13 @@ export function V8IntrinsicIdentifier(
}

export function ModuleExpression(this: Printer, node: t.ModuleExpression) {
// ensure no line terminator between `module` and `{`
const { _noLineTerminator } = this;
this._noLineTerminator = true;
this.word("module");
this.printInnerComments(node);
this.space();
// ensure no line terminator between `module` and `{`
this.ensureNoLineTerminator(() => {
this.printInnerComments(node);
this.space();
});
this.token("{");
this._noLineTerminator = _noLineTerminator;
this.indent();
const { body } = node;
if (body.body.length || body.directives.length) {
Expand Down

0 comments on commit 160b1f2

Please sign in to comment.