Use strict equalities in web/compatibility.js

This commit is contained in:
Tim van der Meij 2014-07-31 22:02:56 +02:00
parent ddd3c8fc2f
commit 097bf41285

View File

@ -237,7 +237,7 @@ if (typeof PDFJS === 'undefined') {
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
window.atob = function (input) {
input = input.replace(/=+$/, '');
if (input.length % 4 == 1) {
if (input.length % 4 === 1) {
throw new Error('bad atob input');
}
for (
@ -293,7 +293,7 @@ if (typeof PDFJS === 'undefined') {
var dataset = {};
for (var j = 0, jj = this.attributes.length; j < jj; j++) {
var attribute = this.attributes[j];
if (attribute.name.substring(0, 5) != 'data-') {
if (attribute.name.substring(0, 5) !== 'data-') {
continue;
}
var key = attribute.name.substring(5).replace(/\-([a-z])/g,
@ -416,7 +416,7 @@ if (typeof PDFJS === 'undefined') {
function isDisabled(node) {
return node.disabled || (node.parentNode && isDisabled(node.parentNode));
}
if (navigator.userAgent.indexOf('Opera') != -1) {
if (navigator.userAgent.indexOf('Opera') !== -1) {
// use browser detection since we cannot feature-check this bug
document.addEventListener('click', ignoreIfTargetDisabled, true);
}