MCPcopy
hub / github.com/rollup/rollup / ChainExpression

Class ChainExpression

src/ast/nodes/ChainExpression.ts:16–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14} from './shared/Node';
15
16export default class ChainExpression extends NodeBase implements DeoptimizableEntity {
17 declare expression: CallExpression | MemberExpression;
18 declare type: NodeType.tChainExpression;
19
20 // deoptimizations are not relevant as we are not caching values
21 deoptimizeCache(): void {}
22
23 getLiteralValueAtPath(
24 path: ObjectPath,
25 recursionTracker: EntityPathTracker,
26 origin: DeoptimizableEntity
27 ): LiteralValueOrUnknown {
28 const literalValue = this.expression.getLiteralValueAtPathAsChainElement(
29 path,
30 recursionTracker,
31 origin
32 );
33 return literalValue === IS_SKIPPED_CHAIN ? undefined : literalValue;
34 }
35
36 hasEffects(context: HasEffectsContext): boolean {
37 return this.expression.hasEffectsAsChainElement(context) === true;
38 }
39
40 includePath(path: ObjectPath, context: InclusionContext) {
41 this.included = true;
42 this.expression.includePath(path, context);
43 }
44
45 removeAnnotations(code: MagicString) {
46 this.expression.removeAnnotations(code);
47 }
48}
49
50ChainExpression.prototype.includeNode = onlyIncludeSelfNoDeoptimize;
51ChainExpression.prototype.applyDeoptimizations = doNotDeoptimize;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…