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

Commit 0235420

Browse files
esarbanisIgorMinar
authored andcommitted
chore: use triple equals comparison with typeof operator.
It is common practice for typeof operator to be used with '==='. Closes #8009
1 parent 19b6b34 commit 0235420

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/Angular.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ function assertArgFn(arg, name, acceptArrayAnnotation) {
15041504
}
15051505

15061506
assertArg(isFunction(arg), name, 'not a function, got ' +
1507-
(arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
1507+
(arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
15081508
return arg;
15091509
}
15101510

src/auto/injector.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function annotate(fn, strictDi, name) {
8484
argDecl,
8585
last;
8686

87-
if (typeof fn == 'function') {
87+
if (typeof fn === 'function') {
8888
if (!($inject = fn.$inject)) {
8989
$inject = [];
9090
if (fn.length) {

src/ng/controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function $ControllerProvider() {
7474
instance = $injector.instantiate(expression, locals, constructor);
7575

7676
if (identifier) {
77-
if (!(locals && typeof locals.$scope == 'object')) {
77+
if (!(locals && typeof locals.$scope === 'object')) {
7878
throw minErr('$controller')('noscp',
7979
"Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",
8080
constructor || expression.name, identifier);

src/ng/filter/filter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function filterFilter() {
195195
// jshint +W086
196196
for (var key in expression) {
197197
(function(path) {
198-
if (typeof expression[path] == 'undefined') return;
198+
if (typeof expression[path] === 'undefined') return;
199199
predicates.push(function(value) {
200200
return search(path == '$' ? value : (value && value[path]), expression[path]);
201201
});

src/ng/rootScope.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ function $RootScopeProvider(){
698698
if ((value = watch.get(current)) !== (last = watch.last) &&
699699
!(watch.eq
700700
? equals(value, last)
701-
: (typeof value == 'number' && typeof last == 'number'
701+
: (typeof value === 'number' && typeof last === 'number'
702702
&& isNaN(value) && isNaN(last)))) {
703703
dirty = true;
704704
lastDirtyWatch = watch;

src/ngScenario/Scenario.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ _jQuery.fn.bindings = function(windowJquery, bindExp) {
294294
function push(value) {
295295
if (value === undefined) {
296296
value = '';
297-
} else if (typeof value != 'string') {
297+
} else if (typeof value !== 'string') {
298298
value = angular.toJson(value);
299299
}
300300
result.push('' + value);

0 commit comments

Comments
 (0)