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

Commit 28b2a9b

Browse files
jbedardNarretz
authored andcommitted
style($compile,$controller): adding function names for debug/tracing
Closes #13420
1 parent e854937 commit 28b2a9b

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
/**
@@ -1731,8 +1731,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
17311731
}
17321732

17331733
function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {
1734-
1735-
var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
1734+
function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
17361735

17371736
if (!transcludedScope) {
17381737
transcludedScope = scope.$new(false, containingScope);
@@ -1744,7 +1743,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
17441743
transcludeControllers: controllers,
17451744
futureParentElement: futureParentElement
17461745
});
1747-
};
1746+
}
17481747

17491748
// We need to attach the transclusion slots onto the `boundTranscludeFn`
17501749
// so that they are available inside the `controllersBoundTransclude` function
@@ -1909,7 +1908,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
19091908
* @returns {Function}
19101909
*/
19111910
function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {
1912-
return function(scope, element, attrs, controllers, transcludeFn) {
1911+
return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) {
19131912
element = groupScan(element[0], attrStart, attrEnd);
19141913
return linkFn(scope, element, attrs, controllers, transcludeFn);
19151914
};
@@ -1932,7 +1931,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
19321931
if (eager) {
19331932
return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
19341933
}
1935-
return function() {
1934+
return function lazyCompilation() {
19361935
if (!compiled) {
19371936
compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
19381937

@@ -2998,7 +2997,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
29982997
// only occurs for isolate scopes and new scopes with controllerAs.
29992998
function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {
30002999
var removeWatchCollection = [];
3001-
forEach(bindings, function(definition, scopeName) {
3000+
forEach(bindings, function initializeBinding(definition, scopeName) {
30023001
var attrName = definition.attrName,
30033002
optional = definition.optional,
30043003
mode = definition.mode, // @, =, or &
@@ -3040,7 +3039,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
30403039
if (parentGet.literal) {
30413040
compare = equals;
30423041
} else {
3043-
compare = function(a, b) { return a === b || (a !== a && b !== b); };
3042+
compare = function simpleCompare(a, b) { return a === b || (a !== a && b !== b); };
30443043
}
30453044
parentSet = parentGet.assign || function() {
30463045
// 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)