Skip to content

Commit

Permalink
style($parse): small readability improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar committed Aug 19, 2014
1 parent 472019f commit f7fde04
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ng/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ function $ParseProvider() {
this.$get = ['$filter', '$sniffer', function($filter, $sniffer) {
$parseOptions.csp = $sniffer.csp;

return function(exp, interceptorFn) {
return function $parse(exp, interceptorFn) {
var parsedExpression, oneTime, cacheKey;

switch (typeof exp) {
Expand All @@ -1012,10 +1012,10 @@ function $ParseProvider() {
parsedExpression = parser.parse(exp);

if (parsedExpression.constant) {
parsedExpression.$$watchDelegate = constantWatch;
parsedExpression.$$watchDelegate = constantWatchDelegate;
} else if (oneTime) {
parsedExpression.$$watchDelegate = parsedExpression.literal ?
oneTimeLiteralWatch : oneTimeWatch;
oneTimeLiteralWatchDelegate : oneTimeWatchDelegate;
}

cache[cacheKey] = parsedExpression;
Expand All @@ -1030,7 +1030,7 @@ function $ParseProvider() {
}
};

function oneTimeWatch(scope, listener, objectEquality, parsedExpression) {
function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) {
var unwatch, lastValue;
return unwatch = scope.$watch(function oneTimeWatch(scope) {
return parsedExpression(scope);
Expand All @@ -1049,7 +1049,7 @@ function $ParseProvider() {
}, objectEquality);
}

function oneTimeLiteralWatch(scope, listener, objectEquality, parsedExpression) {
function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) {
var unwatch;
return unwatch = scope.$watch(function oneTimeWatch(scope) {
return parsedExpression(scope);
Expand All @@ -1073,7 +1073,7 @@ function $ParseProvider() {
}
}

function constantWatch(scope, listener, objectEquality, parsedExpression) {
function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {
var unwatch;
return unwatch = scope.$watch(function constantWatch(scope) {
return parsedExpression(scope);
Expand Down

0 comments on commit f7fde04

Please sign in to comment.