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

Commit a5f84bf

Browse files
refactor: use isDefined and isUndefined consistently
Fix any place that x == undefined or x != undefined to use isUndefined and isDefined instead Closes #4365
1 parent a22e24f commit a5f84bf

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/ngCookies/cookieWriter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function $$CookieWriter($document, $log, $browser) {
2020
options = options || {};
2121
expires = options.expires;
2222
path = angular.isDefined(options.path) ? options.path : cookiePath;
23-
if (isUndefined(value)) {
23+
if (angular.isUndefined(value)) {
2424
expires = 'Thu, 01 Jan 1970 00:00:00 GMT';
2525
value = '';
2626
}

src/ngMock/angular-mocks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ angular.mock.$Browser = function() {
8787
if (fn.id === deferId) fnIndex = index;
8888
});
8989

90-
if (isDefined(fnIndex)) {
90+
if (angular.isDefined(fnIndex)) {
9191
self.deferredFns.splice(fnIndex, 1);
9292
return true;
9393
}
@@ -462,7 +462,7 @@ angular.mock.$IntervalProvider = function() {
462462
if (fn.id === promise.$$intervalId) fnIndex = index;
463463
});
464464

465-
if (isDefined(fnIndex)) {
465+
if (angular.isDefined(fnIndex)) {
466466
repeatFns.splice(fnIndex, 1);
467467
}
468468
}
@@ -504,7 +504,7 @@ angular.mock.$IntervalProvider = function() {
504504
if (fn.id === promise.$$intervalId) fnIndex = index;
505505
});
506506

507-
if (isDefined(fnIndex)) {
507+
if (angular.isDefined(fnIndex)) {
508508
repeatFns[fnIndex].deferred.reject('canceled');
509509
repeatFns.splice(fnIndex, 1);
510510
return true;

src/ngResource/resource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function lookupDottedPath(obj, path) {
1717
throw $resourceMinErr('badmember', 'Dotted member path "@{0}" is invalid.', path);
1818
}
1919
var keys = path.split('.');
20-
for (var i = 0, ii = keys.length; i < ii && isDefined(obj); i++) {
20+
for (var i = 0, ii = keys.length; i < ii && angular.isDefined(obj); i++) {
2121
var key = keys[i];
2222
obj = (obj !== null) ? obj[key] : undefined;
2323
}

src/ngScenario/Scenario.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ _jQuery.fn.bindings = function(windowJquery, bindExp) {
293293
}
294294

295295
function push(value) {
296-
if (isUndefined(value)) {
296+
if (angular.isUndefined(value)) {
297297
value = '';
298298
} else if (typeof value !== 'string') {
299299
value = angular.toJson(value);

0 commit comments

Comments
 (0)