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

Function parseMetaProperty

packages/babel-parser/src/parser/expression.ts:1669–1688  ·  view source on GitHub ↗
(
    node: Undone<N.MetaProperty>,
    meta: N.Identifier,
    propertyName: string,
  )

Source from the content-addressed store, hash-verified

1667 }
1668
1669 parseMetaProperty(
1670 node: Undone<N.MetaProperty>,
1671 meta: N.Identifier,
1672 propertyName: string,
1673 ): N.MetaProperty {
1674 node.meta = meta;
1675
1676 const containsEsc = this.state.containsEsc;
1677
1678 node.property = this.parseIdentifier(true);
1679
1680 if (node.property.name !== propertyName || containsEsc) {
1681 this.raise(Errors.UnsupportedMetaProperty, node.property, {
1682 target: meta.name,
1683 onlyValidPropertyName: propertyName,
1684 });
1685 }
1686
1687 return this.finishNode(node, "MetaProperty");
1688 }
1689
1690 // https://tc39.es/ecma262/#prod-ImportMeta
1691 // https://tc39.es/proposal-source-phase-imports/

Callers

nothing calls this directly

Calls 2

parseIdentifierMethod · 0.80
finishNodeMethod · 0.80

Tested by

no test coverage detected