(
this: Parser,
classBody: Undone<N.ClassBody>,
member: Undone<
N.StaticBlock & {
decorators?: N.Decorator[];
}
>,
)
| 1993 | } |
| 1994 | |
| 1995 | parseClassStaticBlock( |
| 1996 | this: Parser, |
| 1997 | classBody: Undone<N.ClassBody>, |
| 1998 | member: Undone< |
| 1999 | N.StaticBlock & { |
| 2000 | decorators?: N.Decorator[]; |
| 2001 | } |
| 2002 | >, |
| 2003 | ) { |
| 2004 | // Start a new lexical scope |
| 2005 | this.scope.enter( |
| 2006 | ScopeFlag.CLASS | ScopeFlag.STATIC_BLOCK | ScopeFlag.SUPER, |
| 2007 | ); |
| 2008 | // Start a new scope with regard to loop labels |
| 2009 | const oldLabels = this.state.labels; |
| 2010 | this.state.labels = []; |
| 2011 | // ClassStaticBlockStatementList: |
| 2012 | // StatementList[~Yield, ~Await, ~Return] opt |
| 2013 | this.prodParam.enter(ParamKind.PARAM); |
| 2014 | const body: N.Statement[] = (member.body = []); |
| 2015 | this.parseBlockOrModuleBlockBody(body, undefined, false, tt.braceR); |
| 2016 | this.prodParam.exit(); |
| 2017 | this.scope.exit(); |
| 2018 | this.state.labels = oldLabels; |
| 2019 | classBody.body.push(this.finishNode<N.StaticBlock>(member, "StaticBlock")); |
| 2020 | if (member.decorators?.length) { |
| 2021 | this.raise(Errors.DecoratorStaticBlock, member); |
| 2022 | } |
| 2023 | } |
| 2024 | |
| 2025 | pushClassProperty( |
| 2026 | this: Parser, |
nothing calls this directly
no test coverage detected