8000 chore: use triple equals comparison with typeof operator. · blob42/angular.js@55f99e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 55f99e0

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 angular#8009
1 parent 1a99ca9 commit 55f99e0

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/Angular.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ function assertArgFn(arg, name, acceptArrayAnnotation) {
14091409
}
14101410

14111411
assertArg(isFunction(arg), name, 'not a function, got ' +
1412-
(arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
1412+
(arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
14131413
return arg;
14141414
}
14151415

src/auto/injector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function annotate(fn) {
7272
argDecl,
7373
last;
7474

75-
if (typeof fn == 'function') {
75+
if (typeof fn === 'function') {
7676
if (!($inject = fn.$inject)) {
7777
$inject = [];
7878
if (fn.length) {

src/ng/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function $ControllerProvider() {
7474
instance = $injector.instantiate(expression, locals);
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ function $RootScopeProvider(){
639639
if ((value = watch.get(current)) !== (last = watch.last) &&
640640
!(watch.eq
641641
? equals(value, last)
642-
: (typeof value == 'number' && typeof last == 'number'
642+
: (typeof value === 'number' && typeof last === 'number'
643643
&& isNaN(value) && isNaN(last)))) {
644644
dirty = true;
645645
lastDirtyWatch = watch;

src/ngScenario/Scenario.js

Lines changed: 1 addition & 1 deletion
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)
0