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

Function parseBlockBody

packages/babel-parser/src/parser/statement.ts:1263–1281  ·  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

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected