* A function generator that is used to support both eager and lazy compilation * linking function. * @param eager * @param $compileNodes * @param transcludeFn * @param maxPriority * @param ignoreDirective * @param previousCompileContext * @returns {Function}
(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext)
| 9590 | * @returns {Function} |
| 9591 | */ |
| 9592 | function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) { |
| 9593 | var compiled; |
| 9594 | |
| 9595 | if (eager) { |
| 9596 | return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 9597 | } |
| 9598 | return /** @this */ function lazyCompilation() { |
| 9599 | if (!compiled) { |
| 9600 | compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 9601 | |
| 9602 | // Null out all of these references in order to make them eligible for garbage collection |
| 9603 | // since this is a potentially long lived closure |
| 9604 | $compileNodes = transcludeFn = previousCompileContext = null; |
| 9605 | } |
| 9606 | return compiled.apply(this, arguments); |
| 9607 | }; |
| 9608 | } |
| 9609 | |
| 9610 | /** |
| 9611 | * Once the directives have been collected, their compile functions are executed. This method |
no test coverage detected