* 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)
| 10163 | * @returns {Function} |
| 10164 | */ |
| 10165 | function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) { |
| 10166 | var compiled; |
| 10167 | |
| 10168 | if (eager) { |
| 10169 | return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 10170 | } |
| 10171 | return /** @this */ function lazyCompilation() { |
| 10172 | if (!compiled) { |
| 10173 | compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 10174 | |
| 10175 | // Null out all of these references in order to make them eligible for garbage collection |
| 10176 | // since this is a potentially long lived closure |
| 10177 | $compileNodes = transcludeFn = previousCompileContext = null; |
| 10178 | } |
| 10179 | return compiled.apply(this, arguments); |
| 10180 | }; |
| 10181 | } |
| 10182 | |
| 10183 | /** |
| 10184 | * Once the directives have been collected, their compile functions are executed. This method |
no test coverage detected