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

Commit 62955b0

Browse files
committed
style($compile,$controller): adding function names for debug/tracing
1 parent 7ffb2d3 commit 62955b0

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
@@ -476,7 +476,7 @@ function identity($) {return $;}
476476
identity.$inject = [];
477477

478478

479-
function valueFn(value) {return function() {return value;};}
479+
function valueFn(value) {return function valueRef() {return value;};}
480480

481481
function hasCustomToString(obj) {
482482
return isFunction(obj.toString) && obj.toString !== toString;

src/ng/compile.js

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

992992
var SIMPLE_ATTR_NAME = /^\w/;
993993
var specialAttrHolder = document.createElement('div');
994-
var Attributes = function(element, attributesToCopy) {
994+
function Attributes(element, attributesToCopy) {
995995
if (attributesToCopy) {
996996
var keys = Object.keys(attributesToCopy);
997997
var i, l, key;
@@ -1005,7 +1005,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
10051005
}
10061006

10071007
this.$$element = element;
1008-
};
1008+
}
10091009

10101010
Attributes.prototype = {
10111011
/**
@@ -1492,8 +1492,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
14921492
}
14931493

14941494
function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {
1495-
1496-
var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
1495+
function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
14971496

14981497
if (!transcludedScope) {
14991498
transcludedScope = scope.$new(false, containingScope);
@@ -1505,7 +1504,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
15051504
transcludeControllers: controllers,
15061505
futureParentElement: futureParentElement
15071506
});
1508-
};
1507+
}
15091508

15101509
// We need to attach the transclusion slots onto the `boundTranscludeFn`
15111510
// so that they are available inside the `controllersBoundTransclude` function
@@ -1666,7 +1665,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
16661665
* @returns {Function}
16671666
*/
16681667
function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {
1669-
return function(scope, element, attrs, controllers, transcludeFn) {
1668+
return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) {
16701669
element = groupScan(element[0], attrStart, attrEnd);
16711670
return linkFn(scope, element, attrs, controllers, transcludeFn);
16721671
};
@@ -1690,7 +1689,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
16901689

16911690
var compiled;
16921691

1693-
return function() {
1692+
return function lazyCompilation() {
16941693
if (!compiled) {
16951694
compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
16961695

@@ -2712,7 +2711,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
27122711
// only occurs for isolate scopes and new scopes with controllerAs.
27132712
function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {
27142713
var removeWatchCollection = [];
2715-
forEach(bindings, function(definition, scopeName) {
2714+
forEach(bindings, function initializeBinding(definition, scopeName) {
27162715
var attrName = definition.attrName,
27172716
optional = definition.optional,
27182717
mode = definition.mode, // @, =, or &
@@ -2749,7 +2748,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
27492748
if (parentGet.literal) {
27502749
compare = equals;
27512750
} else {
2752-
compare = function(a, b) { return a === b || (a !== a && b !== b); };
2751+
compare = function simpleCompare(a, b) { return a === b || (a !== a && b !== b); };
27532752
}
27542753
parentSet = parentGet.assign || function() {
27552754
// 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
@@ -83,7 +83,7 @@ function $ControllerProvider() {
8383
* It's just a simple call to {@link auto.$injector $injector}, but extracted into
8484
* a service, so that one can override this service with [BC version](https://gist.github.com/1649788).
8585
*/
86-
return function(expression, locals, later, ident) {
86+
return function $controller(expression, locals, later, ident) {
8787
// PRIVATE API:
8888
// param `later` --- indicates that the controller's constructor is invoked at a later time.
8989
// If true, $controller will allocate the object with the correct
@@ -134,7 +134,7 @@ function $ControllerProvider() {
134134
}
135135

136136
var instantiate;
137-
return instantiate = extend(function() {
137+
return instantiate = extend(function $controllerInit() {
138138
var result = $injector.invoke(expression, instance, locals, constructor);
139139
if (result !== instance && (isObject(result) || isFunction(result))) {
140140
instance = result;

0 commit comments

Comments
 (0)