| 14 | } from './shared/Node'; |
| 15 | |
| 16 | export 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 | |
| 50 | ChainExpression.prototype.includeNode = onlyIncludeSelfNoDeoptimize; |
| 51 | ChainExpression.prototype.applyDeoptimizations = doNotDeoptimize; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…