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

style($compile,$controller): adding function names for debug/tracing #13420

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ function identity($) {return $;}
identity.$inject = [];


function valueFn(value) {return function() {return value;};}
function valueFn(value) {return function valueRef() {return value;};}

function hasCustomToString(obj) {
return isFunction(obj.toString) && obj.toString !== toString;
Expand Down
17 changes: 8 additions & 9 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {

var SIMPLE_ATTR_NAME = /^\w/;
var specialAttrHolder = document.createElement('div');
var Attributes = function(element, attributesToCopy) {
function Attributes(element, attributesToCopy) {
if (attributesToCopy) {
var keys = Object.keys(attributesToCopy);
var i, l, key;
Expand All @@ -1229,7 +1229,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
}

this.$$element = element;
};
}

Attributes.prototype = {
/**
Expand Down Expand Up @@ -1718,8 +1718,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
}

function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {

var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {

if (!transcludedScope) {
transcludedScope = scope.$new(false, containingScope);
Expand All @@ -1731,7 +1730,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
transcludeControllers: controllers,
futureParentElement: futureParentElement
});
};
}

// We need to attach the transclusion slots onto the `boundTranscludeFn`
// so that they are available inside the `controllersBoundTransclude` function
Expand Down Expand Up @@ -1896,7 +1895,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
* @returns {Function}
*/
function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {
return function(scope, element, attrs, controllers, transcludeFn) {
return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) {
element = groupScan(element[0], attrStart, attrEnd);
return linkFn(scope, element, attrs, controllers, transcludeFn);
};
Expand All @@ -1919,7 +1918,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if (eager) {
return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
}
return function() {
return function lazyCompilation() {
if (!compiled) {
compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);

Expand Down Expand Up @@ -2985,7 +2984,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
// only occurs for isolate scopes and new scopes with controllerAs.
function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {
var removeWatchCollection = [];
forEach(bindings, function(definition, scopeName) {
forEach(bindings, function initializeBinding(definition, scopeName) {
var attrName = definition.attrName,
optional = definition.optional,
mode = definition.mode, // @, =, or &
Expand Down Expand Up @@ -3027,7 +3026,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if (parentGet.literal) {
compare = equals;
} else {
compare = function(a, b) { return a === b || (a !== a && b !== b); };
compare = function simpleCompare(a, b) { return a === b || (a !== a && b !== b); };
}
parentSet = parentGet.assign || function() {
// reset the change, or we will throw this exception on every $digest
Expand Down
4 changes: 2 additions & 2 deletions src/ng/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function $ControllerProvider() {
* It's just a simple call to {@link auto.$injector $injector}, but extracted into
* a service, so that one can override this service with [BC version](https://gist.github.com/1649788).
*/
return function(expression, locals, later, ident) {
return function $controller(expression, locals, later, ident) {
// PRIVATE API:
// param `later` --- indicates that the controller's constructor is invoked at a later time.
// If true, $controller will allocate the object with the correct
Expand Down Expand Up @@ -143,7 +143,7 @@ function $ControllerProvider() {
}

var instantiate;
return instantiate = extend(function() {
return instantiate = extend(function $controllerInit() {
var result = $injector.invoke(expression, instance, locals, constructor);
if (result !== instance && (isObject(result) || isFunction(result))) {
instance = result;
Expand Down