MCPcopy Index your code
hub / github.com/angular/angular / executeOp

Method executeOp

packages/compiler/src/typecheck/ops/scope.ts:446–467  ·  view source on GitHub ↗

* Execute a particular `TcbOp` in the `opQueue`. * * This method replaces the operation in the `opQueue` with the result of execution (once done) * and also protects against a circular dependency from the operation to itself by temporarily * setting the operation's result to a special ex

(opIndex: number, skipOptional: boolean)

Source from the content-addressed store, hash-verified

444 * setting the operation's result to a special expression.
445 */
446 private executeOp(opIndex: number, skipOptional: boolean): TcbExpr | null {
447 const op = this.opQueue[opIndex];
448 if (!(op instanceof TcbOp)) {
449 return op === null ? null : new TcbExpr(op.print(true /* ignoreComments */));
450 }
451
452 if (skipOptional && op.optional) {
453 return null;
454 }
455
456 // Set the result of the operation in the queue to its circular fallback. If executing this
457 // operation results in a circular dependency, this will prevent an infinite loop and allow for
458 // the resolution of such cycles.
459 this.opQueue[opIndex] = op.circularFallback();
460 let res = op.execute();
461 if (res !== null) {
462 res = new TcbExpr(res.print(true /* ignoreComments */));
463 }
464 // Once the operation has finished executing, it's safe to cache the real result.
465 this.opQueue[opIndex] = res;
466 return res;
467 }
468
469 private appendNode(node: Node): void {
470 if (node instanceof Element) {

Callers 2

renderMethod · 0.95
resolveOpMethod · 0.95

Calls 3

circularFallbackMethod · 0.80
executeMethod · 0.65
printMethod · 0.45

Tested by

no test coverage detected