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

Function pushClassProperty

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

nameIsConstructorMethod · 0.80
pushMethod · 0.45
parseClassPropertyMethod · 0.45

Tested by

no test coverage detected