Skip to content

Commit

Permalink
tweak: remove default parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Nov 26, 2022
1 parent 18eebaa commit 7b949f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/babel-parser/src/parser/statement.ts
Expand Up @@ -381,7 +381,7 @@ export default abstract class StatementParser extends ExpressionParser {

parseStatementOrFunctionDeclaration(
this: Parser,
disallowLabeledFunction: boolean = false,
disallowLabeledFunction: boolean,
) {
return this.parseStatementLike(
ParseStatementFlag.AllowFunctionDeclaration |
Expand Down Expand Up @@ -1248,7 +1248,7 @@ export default abstract class StatementParser extends ExpressionParser {
// https://tc39.es/ecma262/#prod-LabelledItem
node.body =
flags & ParseStatementFlag.AllowLabeledFunction
? this.parseStatementOrFunctionDeclaration()
? this.parseStatementOrFunctionDeclaration(false)
: this.parseStatement();

this.state.labels.pop();
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-parser/src/plugins/placeholders.ts
Expand Up @@ -194,7 +194,7 @@ export default (superClass: typeof Parser) =>
const stmt: N.LabeledStatement = node;
stmt.label = this.finishPlaceholder(expr, "Identifier");
this.next();
stmt.body = super.parseStatementOrFunctionDeclaration();
stmt.body = super.parseStatementOrFunctionDeclaration(false);
return this.finishNode(stmt, "LabeledStatement");
}

Expand Down

0 comments on commit 7b949f4

Please sign in to comment.