(
this: Parser,
allowDirectives: boolean = false,
createNewLexicalScope: boolean = true,
afterBlockParse?: (hasStrictModeDirective: boolean) => void,
)
| 1223 | // function bodies). |
| 1224 | |
| 1225 | parseBlock( |
| 1226 | this: Parser, |
| 1227 | allowDirectives: boolean = false, |
| 1228 | createNewLexicalScope: boolean = true, |
| 1229 | afterBlockParse?: (hasStrictModeDirective: boolean) => void, |
| 1230 | ): N.BlockStatement { |
| 1231 | const node = this.startNode<N.BlockStatement>(); |
| 1232 | if (allowDirectives) { |
| 1233 | this.state.strictErrors.clear(); |
| 1234 | } |
| 1235 | this.expect(tt.braceL); |
| 1236 | if (createNewLexicalScope) { |
| 1237 | this.scope.enter(ScopeFlag.OTHER); |
| 1238 | } |
| 1239 | this.parseBlockBody( |
| 1240 | node, |
| 1241 | allowDirectives, |
| 1242 | false, |
| 1243 | tt.braceR, |
| 1244 | afterBlockParse, |
| 1245 | ); |
| 1246 | if (createNewLexicalScope) { |
| 1247 | this.scope.exit(); |
| 1248 | } |
| 1249 | return this.finishNode(node, "BlockStatement"); |
| 1250 | } |
| 1251 | |
| 1252 | isValidDirective(stmt: N.Statement): stmt is N.ExpressionStatement { |
| 1253 | return ( |
nothing calls this directly
no test coverage detected