* 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)
| 9480 | * @returns {Function} |
| 9481 | */ |
| 9482 | function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) { |
| 9483 | var compiled; |
| 9484 | |
| 9485 | if (eager) { |
| 9486 | return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 9487 | } |
| 9488 | return /** @this */ function lazyCompilation() { |
| 9489 | if (!compiled) { |
| 9490 | compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 9491 | |
| 9492 | // Null out all of these references in order to make them eligible for garbage collection |
| 9493 | // since this is a potentially long lived closure |
| 9494 | $compileNodes = transcludeFn = previousCompileContext = null; |
| 9495 | } |
| 9496 | return compiled.apply(this, arguments); |
| 9497 | }; |
| 9498 | } |
| 9499 | |
| 9500 | /** |
| 9501 | * Once the directives have been collected, their compile functions are executed. This method |
no test coverage detected