* 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)
| 9551 | * @returns {Function} |
| 9552 | */ |
| 9553 | function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) { |
| 9554 | var compiled; |
| 9555 | |
| 9556 | if (eager) { |
| 9557 | return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 9558 | } |
| 9559 | return /** @this */ function lazyCompilation() { |
| 9560 | if (!compiled) { |
| 9561 | compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 9562 | |
| 9563 | // Null out all of these references in order to make them eligible for garbage collection |
| 9564 | // since this is a potentially long lived closure |
| 9565 | $compileNodes = transcludeFn = previousCompileContext = null; |
| 9566 | } |
| 9567 | return compiled.apply(this, arguments); |
| 9568 | }; |
| 9569 | } |
| 9570 | |
| 9571 | /** |
| 9572 | * Once the directives have been collected, their compile functions are executed. This method |
no test coverage detected