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

Function parseCatchClauseParam

packages/babel-parser/src/parser/statement.ts:1053–1072  ·  view source on GitHub ↗
(this: Parser)

Source from the content-addressed store, hash-verified

1051 }
1052
1053 parseCatchClauseParam(this: Parser) {
1054 const param = this.parseBindingAtom();
1055
1056 this.scope.enter(
1057 this.options.annexB && param.type === "Identifier"
1058 ? ScopeFlag.SIMPLE_CATCH
1059 : ScopeFlag.OTHER,
1060 );
1061 this.checkLVal(
1062 param,
1063 { type: "CatchClause" },
1064 BindingFlag.TYPE_CATCH_PARAM,
1065 );
1066
1067 // checkLVal ensures that VoidPattern can not be used as a catch clause parameter.
1068 return param as Exclude<
1069 ReturnType<typeof this.parseBindingAtom>,
1070 N.VoidPattern
1071 >;
1072 }
1073
1074 parseTryStatement(
1075 this: Parser,

Callers

nothing calls this directly

Calls 2

parseBindingAtomMethod · 0.45
enterMethod · 0.45

Tested by

no test coverage detected