@@ -944,7 +944,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
944
944
* {@link guide/directive directive guide} and the {@link $compile compile API} for more info.
945
945
* @returns {ng.$compileProvider } Self for chaining.
946
946
*/
947
- this . directive = function registerDirective ( name , directiveFactory ) {
947
+ this . directive = function registerDirective ( name , directiveFactory ) {
948
948
assertNotHasOwnProperty ( name , 'directive' ) ;
949
949
if ( isString ( name ) ) {
950
950
assertValidDirectiveName ( name ) ;
@@ -1913,23 +1913,21 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1913
1913
* @returns {Function }
1914
1914
*/
1915
1915
function compilationGenerator ( eager , $compileNodes , transcludeFn , maxPriority , ignoreDirective , previousCompileContext ) {
1916
- if ( eager ) {
1917
- return compile ( $compileNodes , transcludeFn , maxPriority , ignoreDirective , previousCompileContext ) ;
1918
- }
1919
-
1920
- var compiled ;
1916
+ var compiled ;
1921
1917
1922
- return function ( ) {
1923
- if ( ! compiled ) {
1924
- compiled = compile ( $compileNodes , transcludeFn , maxPriority , ignoreDirective , previousCompileContext ) ;
1925
-
1926
- // Null out all of these references in order to make them eligible for garbage collection
1927
- // since this is a potentially long lived closure
1928
- $compileNodes = transcludeFn = previousCompileContext = null ;
1929
- }
1918
+ if ( eager ) {
1919
+ return compile ( $compileNodes , transcludeFn , maxPriority , ignoreDirective , previousCompileContext ) ;
1920
+ }
1921
+ return function ( ) {
1922
+ if ( ! compiled ) {
1923
+ compiled = compile ( $compileNodes , transcludeFn , maxPriority , ignoreDirective , previousCompileContext ) ;
1930
1924
1931
- return compiled . apply ( this , arguments ) ;
1932
- } ;
1925
+ // Null out all of these references in order to make them eligible for garbage collection
1926
+ // since this is a potentially long lived closure
1927
+ $compileNodes = transcludeFn = previousCompileContext = null ;
1928
+ }
1929
+ return compiled . apply ( this , arguments ) ;
1930
+ } ;
1933
1931
}
1934
1932
1935
1933
/**
0 commit comments