* 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)
| 9031 | * @returns {Function} |
| 9032 | */ |
| 9033 | function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) { |
| 9034 | var compiled; |
| 9035 | |
| 9036 | if (eager) { |
| 9037 | return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 9038 | } |
| 9039 | return /** @this */ function lazyCompilation() { |
| 9040 | if (!compiled) { |
| 9041 | compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 9042 | |
| 9043 | // Null out all of these references in order to make them eligible for garbage collection |
| 9044 | // since this is a potentially long lived closure |
| 9045 | $compileNodes = transcludeFn = previousCompileContext = null; |
| 9046 | } |
| 9047 | return compiled.apply(this, arguments); |
| 9048 | }; |
| 9049 | } |
| 9050 | |
| 9051 | /** |
| 9052 | * Once the directives have been collected, their compile functions are executed. This method |
no test coverage detected