refactor: simplify isPresent(x) ? x : y to x || y (#12166)

Closes #12166
This commit is contained in:
Victor Berchet
2016-10-07 18:11:37 -07:00
committed by Tobias Bosch
parent bdcf46f82e
commit d972d82354
18 changed files with 40 additions and 43 deletions

View File

@ -27,7 +27,7 @@ export class ResourceLoaderImpl extends ResourceLoader {
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
// response/responseType properties were introduced in ResourceLoader Level2 spec (supported
// by IE10)
var response = isPresent(xhr.response) ? xhr.response : xhr.responseText;
var response = xhr.response || xhr.responseText;
// normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
var status = xhr.status === 1223 ? 204 : xhr.status;