Add strict equalities in src/shared/util.js
This commit is contained in:
parent
42e541a671
commit
ccd71e0a94
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
var globalScope = (typeof window === 'undefined') ? this : window;
|
var globalScope = (typeof window === 'undefined') ? this : window;
|
||||||
|
|
||||||
var isWorker = (typeof window == 'undefined');
|
var isWorker = (typeof window === 'undefined');
|
||||||
|
|
||||||
var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
|
var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
|
||||||
|
|
||||||
@ -272,7 +272,7 @@ function combineUrl(baseUrl, url) {
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
var i;
|
var i;
|
||||||
if (url.charAt(0) == '/') {
|
if (url.charAt(0) === '/') {
|
||||||
// absolute path
|
// absolute path
|
||||||
i = baseUrl.indexOf('://');
|
i = baseUrl.indexOf('://');
|
||||||
if (url.charAt(1) === '/') {
|
if (url.charAt(1) === '/') {
|
||||||
@ -946,7 +946,7 @@ function isEmptyObj(obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isBool(v) {
|
function isBool(v) {
|
||||||
return typeof v == 'boolean';
|
return typeof v === 'boolean';
|
||||||
}
|
}
|
||||||
|
|
||||||
function isInt(v) {
|
function isInt(v) {
|
||||||
@ -1099,7 +1099,7 @@ PDFJS.createPromiseCapability = createPromiseCapability;
|
|||||||
pendingRejectionCheck: false,
|
pendingRejectionCheck: false,
|
||||||
|
|
||||||
scheduleHandlers: function scheduleHandlers(promise) {
|
scheduleHandlers: function scheduleHandlers(promise) {
|
||||||
if (promise._status == STATUS_PENDING) {
|
if (promise._status === STATUS_PENDING) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1125,10 +1125,10 @@ PDFJS.createPromiseCapability = createPromiseCapability;
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (nextStatus === STATUS_RESOLVED) {
|
if (nextStatus === STATUS_RESOLVED) {
|
||||||
if (typeof(handler.onResolve) == 'function') {
|
if (typeof handler.onResolve === 'function') {
|
||||||
nextValue = handler.onResolve(nextValue);
|
nextValue = handler.onResolve(nextValue);
|
||||||
}
|
}
|
||||||
} else if (typeof(handler.onReject) === 'function') {
|
} else if (typeof handler.onReject === 'function') {
|
||||||
nextValue = handler.onReject(nextValue);
|
nextValue = handler.onReject(nextValue);
|
||||||
nextStatus = STATUS_RESOLVED;
|
nextStatus = STATUS_RESOLVED;
|
||||||
|
|
||||||
@ -1295,7 +1295,7 @@ PDFJS.createPromiseCapability = createPromiseCapability;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status == STATUS_RESOLVED &&
|
if (status === STATUS_RESOLVED &&
|
||||||
Promise.isPromise(value)) {
|
Promise.isPromise(value)) {
|
||||||
value.then(this._updateStatus.bind(this, STATUS_RESOLVED),
|
value.then(this._updateStatus.bind(this, STATUS_RESOLVED),
|
||||||
this._updateStatus.bind(this, STATUS_REJECTED));
|
this._updateStatus.bind(this, STATUS_REJECTED));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user