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

Function pushClassPrivateMethod

packages/babel-parser/src/parser/statement.ts:2103–2132  ·  view source on GitHub ↗
(
    this: Parser,
    classBody: Undone<N.ClassBody>,
    method: Undone<N.ClassPrivateMethod>,
    isGenerator: boolean,
    isAsync: boolean,
  )

Source from the content-addressed store, hash-verified

2101 }
2102
2103 pushClassPrivateMethod(
2104 this: Parser,
2105 classBody: Undone<N.ClassBody>,
2106 method: Undone<N.ClassPrivateMethod>,
2107 isGenerator: boolean,
2108 isAsync: boolean,
2109 ): void {
2110 const node = this.parseMethod(
2111 method,
2112 isGenerator,
2113 isAsync,
2114 /* isConstructor */ false,
2115 false,
2116 "ClassPrivateMethod",
2117 true,
2118 );
2119 classBody.body.push(node);
2120
2121 const kind =
2122 node.kind === "get"
2123 ? node.static
2124 ? ClassElementType.STATIC_GETTER
2125 : ClassElementType.INSTANCE_GETTER
2126 : node.kind === "set"
2127 ? node.static
2128 ? ClassElementType.STATIC_SETTER
2129 : ClassElementType.INSTANCE_SETTER
2130 : ClassElementType.OTHER;
2131 this.declareClassPrivateMethodInScope(node, kind);
2132 }
2133
2134 declareClassPrivateMethodInScope(
2135 node: Undone<N.ClassPrivateMethod | N.TSDeclareMethod>,

Callers

nothing calls this directly

Calls 3

parseMethodMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected