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

Function pushClassPrivateMethod

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

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