MCPcopy
hub / github.com/angular/angular / push

Method push

packages/compiler/src/template/pipeline/ir/src/operations.ts:89–112  ·  view source on GitHub ↗

* Push a new operation to the tail of the list.

(op: OpT | Array<OpT>)

Source from the content-addressed store, hash-verified

87 * Push a new operation to the tail of the list.
88 */
89 push(op: OpT | Array<OpT>): void {
90 if (Array.isArray(op)) {
91 for (const o of op) {
92 this.push(o);
93 }
94 return;
95 }
96
97 OpList.assertIsNotEnd(op);
98 OpList.assertIsUnowned(op);
99
100 op.debugListId = this.debugListId;
101
102 // The old "previous" node (which might be the head, if the list is empty).
103 const oldLast = this.tail.prev!;
104
105 // Insert `op` following the old last node.
106 op.prev = oldLast;
107 oldLast.next = op;
108
109 // Connect `op` with the list tail.
110 op.next = this.tail;
111 this.tail.prev = op;
112 }
113
114 /**
115 * Prepend one or more nodes to the start of the list.

Callers 15

createAnimationOpFunction · 0.95
createListenerOpFunction · 0.95
createTwoWayListenerOpFunction · 0.95
optimizeTrackFnsFunction · 0.95
visitMethod · 0.45
recordUnparsedMethod · 0.45
captureRulesFunction · 0.45
visitMethod · 0.45
visitElementMethod · 0.45
visitAttributeMethod · 0.45

Calls 3

isArrayMethod · 0.80
assertIsNotEndMethod · 0.80
assertIsUnownedMethod · 0.80

Tested by 5

analyzeMethod · 0.36
popStateListenerFunction · 0.36
setUpEntriesFunction · 0.36
$watchMethod · 0.36
$onMethod · 0.36