chore: use triple equals comparison with typeof operator.

It is common practice for typeof operator to be used with '==='.

Closes #8009
This commit is contained in:
Efthymis Sarbanis
2014-06-28 00:24:04 +03:00
committed by Igor Minar
parent 1a99ca9c08
commit 55f99e0710
6 changed files with 6 additions and 6 deletions

View File

@@ -1409,7 +1409,7 @@ function assertArgFn(arg, name, acceptArrayAnnotation) {
}
assertArg(isFunction(arg), name, 'not a function, got ' +
(arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
(arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
return arg;
}

View File

@@ -72,7 +72,7 @@ function annotate(fn) {
argDecl,
last;
if (typeof fn == 'function') {
if (typeof fn === 'function') {
if (!($inject = fn.$inject)) {
$inject = [];
if (fn.length) {

View File

@@ -74,7 +74,7 @@ function $ControllerProvider() {
instance = $injector.instantiate(expression, locals);
if (identifier) {
if (!(locals && typeof locals.$scope == 'object')) {
if (!(locals && typeof locals.$scope === 'object')) {
throw minErr('$controller')('noscp',
"Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",
constructor || expression.name, identifier);

View File

@@ -195,7 +195,7 @@ function filterFilter() {
// jshint +W086
for (var key in expression) {
(function(path) {
if (typeof expression[path] == 'undefined') return;
if (typeof expression[path] === 'undefined') return;
predicates.push(function(value) {
return search(path == '$' ? value : (value && value[path]), expression[path]);
});

View File

@@ -639,7 +639,7 @@ function $RootScopeProvider(){
if ((value = watch.get(current)) !== (last = watch.last) &&
!(watch.eq
? equals(value, last)
: (typeof value == 'number' && typeof last == 'number'
: (typeof value === 'number' && typeof last === 'number'
&& isNaN(value) && isNaN(last)))) {
dirty = true;
lastDirtyWatch = watch;

View File

@@ -294,7 +294,7 @@ _jQuery.fn.bindings = function(windowJquery, bindExp) {
function push(value) {
if (value === undefined) {
value = '';
} else if (typeof value != 'string') {
} else if (typeof value !== 'string') {
value = angular.toJson(value);
}
result.push('' + value);