* 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)
| 10098 | * @returns {Function} |
| 10099 | */ |
| 10100 | function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) { |
| 10101 | var compiled; |
| 10102 | |
| 10103 | if (eager) { |
| 10104 | return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 10105 | } |
| 10106 | return /** @this */ function lazyCompilation() { |
| 10107 | if (!compiled) { |
| 10108 | compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 10109 | |
| 10110 | // Null out all of these references in order to make them eligible for garbage collection |
| 10111 | // since this is a potentially long lived closure |
| 10112 | $compileNodes = transcludeFn = previousCompileContext = null; |
| 10113 | } |
| 10114 | return compiled.apply(this, arguments); |
| 10115 | }; |
| 10116 | } |
| 10117 | |
| 10118 | /** |
| 10119 | * Once the directives have been collected, their compile functions are executed. This method |
no test coverage detected