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

Function pushClassProperty

packages/babel-parser/src/parser/statement.ts:2028–2040  ·  view source on GitHub ↗
(
    this: Parser,
    classBody: Undone<N.ClassBody>,
    prop: Undone<N.ClassProperty>,
  )

Source from the content-addressed store, hash-verified

2026 }
2027
2028 pushClassProperty(
2029 this: Parser,
2030 classBody: Undone<N.ClassBody>,
2031 prop: Undone<N.ClassProperty>,
2032 ) {
2033 if (!prop.computed && this.nameIsConstructor(prop.key)) {
2034 // Non-computed field, which is either an identifier named "constructor"
2035 // or a string literal named "constructor"
2036 this.raise(Errors.ConstructorClassField, prop.key);
2037 }
2038
2039 classBody.body.push(this.parseClassProperty(prop));
2040 }
2041
2042 pushClassPrivateProperty(
2043 this: Parser,

Callers

nothing calls this directly

Calls 3

nameIsConstructorMethod · 0.80
pushMethod · 0.45
parseClassPropertyMethod · 0.45

Tested by

no test coverage detected