MCPcopy Create free account
hub / github.com/babel/babel / parseBlockBody

Function parseBlockBody

packages/babel-parser/src/parser/statement.ts:1260–1278  ·  view source on GitHub ↗
(
    this: Parser,
    node: Undone<N.BlockStatementLike>,
    allowDirectives: boolean | undefined | null,
    topLevel: boolean,
    end: TokenType,
    afterBlockParse?: (hasStrictModeDirective: boolean) => void,
  )

Source from the content-addressed store, hash-verified

1258 }
1259
1260 parseBlockBody(
1261 this: Parser,
1262 node: Undone<N.BlockStatementLike>,
1263 allowDirectives: boolean | undefined | null,
1264 topLevel: boolean,
1265 end: TokenType,
1266 afterBlockParse?: (hasStrictModeDirective: boolean) => void,
1267 ): void {
1268 const body: N.BlockStatementLike["body"] = (node.body = []);
1269 const directives: N.BlockStatementLike["directives"] = (node.directives =
1270 []);
1271 this.parseBlockOrModuleBlockBody(
1272 body,
1273 allowDirectives ? directives : undefined,
1274 topLevel,
1275 end,
1276 afterBlockParse,
1277 );
1278 }
1279
1280 // Undefined directives means that directives are not allowed.
1281 // https://tc39.es/ecma262/#prod-Block

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected