* 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)
| 8429 | * @returns {Function} |
| 8430 | */ |
| 8431 | function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) { |
| 8432 | if (eager) { |
| 8433 | return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 8434 | } |
| 8435 | |
| 8436 | var compiled; |
| 8437 | |
| 8438 | return function() { |
| 8439 | if (!compiled) { |
| 8440 | compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); |
| 8441 | |
| 8442 | // Null out all of these references in order to make them eligible for garbage collection |
| 8443 | // since this is a potentially long lived closure |
| 8444 | $compileNodes = transcludeFn = previousCompileContext = null; |
| 8445 | } |
| 8446 | |
| 8447 | return compiled.apply(this, arguments); |
| 8448 | }; |
| 8449 | } |
| 8450 | |
| 8451 | /** |
| 8452 | * Once the directives have been collected, their compile functions are executed. This method |
no test coverage detected