Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c51fca4

Browse files
committed
style($compile,$controller): adding function names for debug/tracing
1 parent 4883e95 commit c51fca4

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/Angular.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ function identity($) {return $;}
457457
identity.$inject = [];
458458

459459

460-
function valueFn(value) {return function() {return value;};}
460+
function valueFn(value) {return function valueRef() {return value;};}
461461

462462
function hasCustomToString(obj) {
463463
return isFunction(obj.toString) && obj.toString !== toString;

src/ng/compile.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
12151215

12161216
var SIMPLE_ATTR_NAME = /^\w/;
12171217
var specialAttrHolder = document.createElement('div');
1218-
var Attributes = function(element, attributesToCopy) {
1218+
function Attributes(element, attributesToCopy) {
12191219
if (attributesToCopy) {
12201220
var keys = Object.keys(attributesToCopy);
12211221
var i, l, key;
@@ -1229,7 +1229,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
12291229
}
12301230

12311231
this.$$element = element;
1232-
};
1232+
}
12331233

12341234
Attributes.prototype = {
12351235
/**
@@ -1718,8 +1718,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
17181718
}
17191719

17201720
function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {
1721-
1722-
var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
1721+
function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
17231722

17241723
if (!transcludedScope) {
17251724
transcludedScope = scope.$new(false, containingScope);
@@ -1731,7 +1730,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
17311730
transcludeControllers: controllers,
17321731
futureParentElement: futureParentElement
17331732
});
1734-
};
1733+
}
17351734

17361735
// We need to attach the transclusion slots onto the `boundTranscludeFn`
17371736
// so that they are available inside the `controllersBoundTransclude` function
@@ -1896,7 +1895,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
18961895
* @returns {Function}
18971896
*/
18981897
function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {
1899-
return function(scope, element, attrs, controllers, transcludeFn) {
1898+
return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) {
19001899
element = groupScan(element[0], attrStart, attrEnd);
19011900
return linkFn(scope, element, attrs, controllers, transcludeFn);
19021901
};
@@ -1919,7 +1918,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
19191918
if (eager) {
19201919
return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
19211920
}
1922-
return function() {
1921+
return function lazyCompilation() {
19231922
if (!compiled) {
19241923
compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
19251924

@@ -2985,7 +2984,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
29852984
// only occurs for isolate scopes and new scopes with controllerAs.
29862985
function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {
29872986
var removeWatchCollection = [];
2988-
forEach(bindings, function(definition, scopeName) {
2987+
forEach(bindings, function initializeBinding(definition, scopeName) {
29892988
var attrName = definition.attrName,
29902989
optional = definition.optional,
29912990
mode = definition.mode, // @, =, or &
@@ -3027,7 +3026,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
30273026
if (parentGet.literal) {
30283027
compare = equals;
30293028
} else {
3030-
compare = function(a, b) { return a === b || (a !== a && b !== b); };
3029+
compare = function simpleCompare(a, b) { return a === b || (a !== a && b !== b); };
30313030
}
30323031
parentSet = parentGet.assign || function() {
30333032
// reset the change, or we will throw this exception on every $digest

src/ng/controller.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function $ControllerProvider() {
9292
* It's just a simple call to {@link auto.$injector $injector}, but extracted into
9393
* a service, so that one can override this service with [BC version](https://gist.github.com/1649788).
9494
*/
95-
return function(expression, locals, later, ident) {
95+
return function $controller(expression, locals, later, ident) {
9696
// PRIVATE API:
9797
// param `later` --- indicates that the controller's constructor is invoked at a later time.
9898
// If true, $controller will allocate the object with the correct
@@ -143,7 +143,7 @@ function $ControllerProvider() {
143143
}
144144

145145
var instantiate;
146-
return instantiate = extend(function() {
146+
return instantiate = extend(function $controllerInit() {
147147
var result = $injector.invoke(expression, instance, locals, constructor);
148148
if (result !== instance && (isObject(result) || isFunction(result))) {
149149
instance = result;

0 commit comments

Comments
 (0)