From 06835a462afc7105532e13abdd5217314b3ae71e Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 5 Aug 2011 16:24:12 -0700 Subject: style($function): replace $function with 'function' --- src/Angular.js | 5 ++--- src/JSON.js | 2 +- src/apis.js | 2 +- src/parser.js | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Angular.js b/src/Angular.js index f876dde0..d698aa11 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -64,7 +64,6 @@ var _undefined = undefined, $console = 'console', $date = 'date', $display = 'display', - $function = 'function', $length = 'length', $name = 'name', $noop = 'noop', @@ -420,7 +419,7 @@ function isArray(value) { return value instanceof Array; } * @param {*} value Reference to check. * @returns {boolean} True if `value` is a `Function`. */ -function isFunction(value){ return typeof value == $function;} +function isFunction(value){ return typeof value == 'function';} /** @@ -819,7 +818,7 @@ function sliceArgs(args, startIndex) { */ function bind(self, fn) { var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : []; - if (typeof fn == $function && !(fn instanceof RegExp)) { + if (isFunction(fn) && !(fn instanceof RegExp)) { return curryArgs.length ? function() { return arguments.length diff --git a/src/JSON.js b/src/JSON.js index b0f72a1b..02c1a613 100644 --- a/src/JSON.js +++ b/src/JSON.js @@ -136,7 +136,7 @@ function toJsonArray(buf, obj, pretty, stack) { for ( var keyIndex = 0; keyIndex < keys.length; keyIndex++) { var key = keys[keyIndex]; var value = obj[key]; - if (typeof value != $function) { + if (!isFunction(value)) { if (comma) { buf.push(","); if (pretty) buf.push(pretty); diff --git a/src/apis.js b/src/apis.js index 8a566a46..3a9671a8 100644 --- a/src/apis.js +++ b/src/apis.js @@ -394,7 +394,7 @@ var angularArray = { } } break; - case $function: + case 'function': predicates.push(expression); break; default: diff --git a/src/parser.js b/src/parser.js index 9f2442de..dadab1fb 100644 --- a/src/parser.js +++ b/src/parser.js @@ -515,7 +515,7 @@ function parser(text, json){ if (instance) instance = instance[key]; } - if (typeof instance != $function) { + if (!isFunction(instance)) { throwError("should be a function", token); } return instance; @@ -765,7 +765,7 @@ function compileExpr(expr) { // TODO(misko): Deprecate? Remove! // I think that compilation should be a service. function expressionCompile(exp) { - if (typeof exp === $function) return exp; + if (isFunction(exp)) return exp; var fn = compileCache[exp]; if (!fn) { fn = compileCache[exp] = parser(exp).statements(); -- cgit v1.2.3