Merge pull request #5113 from Snuffleupagus/strict-equalities-src-display
Add strict equalities in src/display/*
This commit is contained in:
commit
df0b821141
@ -503,8 +503,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
|
|||||||
// this call to render.
|
// this call to render.
|
||||||
this.pendingDestroy = false;
|
this.pendingDestroy = false;
|
||||||
|
|
||||||
var renderingIntent = ('intent' in params ?
|
var renderingIntent = (params.intent === 'print' ? 'print' : 'display');
|
||||||
(params.intent == 'print' ? 'print' : 'display') : 'display');
|
|
||||||
|
|
||||||
if (!this.intentStates[renderingIntent]) {
|
if (!this.intentStates[renderingIntent]) {
|
||||||
this.intentStates[renderingIntent] = {};
|
this.intentStates[renderingIntent] = {};
|
||||||
@ -1003,7 +1002,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
|||||||
messageHandler.on('JpegDecode', function(data) {
|
messageHandler.on('JpegDecode', function(data) {
|
||||||
var imageUrl = data[0];
|
var imageUrl = data[0];
|
||||||
var components = data[1];
|
var components = data[1];
|
||||||
if (components != 3 && components != 1) {
|
if (components !== 3 && components !== 1) {
|
||||||
return Promise.reject(
|
return Promise.reject(
|
||||||
new Error('Only 3 components or 1 component can be returned'));
|
new Error('Only 3 components or 1 component can be returned'));
|
||||||
}
|
}
|
||||||
@ -1022,13 +1021,13 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
|||||||
var data = tmpCtx.getImageData(0, 0, width, height).data;
|
var data = tmpCtx.getImageData(0, 0, width, height).data;
|
||||||
var i, j;
|
var i, j;
|
||||||
|
|
||||||
if (components == 3) {
|
if (components === 3) {
|
||||||
for (i = 0, j = 0; i < rgbaLength; i += 4, j += 3) {
|
for (i = 0, j = 0; i < rgbaLength; i += 4, j += 3) {
|
||||||
buf[j] = data[i];
|
buf[j] = data[i];
|
||||||
buf[j + 1] = data[i + 1];
|
buf[j + 1] = data[i + 1];
|
||||||
buf[j + 2] = data[i + 2];
|
buf[j + 2] = data[i + 2];
|
||||||
}
|
}
|
||||||
} else if (components == 1) {
|
} else if (components === 1) {
|
||||||
for (i = 0, j = 0; i < rgbaLength; i += 4, j++) {
|
for (i = 0, j = 0; i < rgbaLength; i += 4, j++) {
|
||||||
buf[j] = data[i];
|
buf[j] = data[i];
|
||||||
}
|
}
|
||||||
|
@ -1227,7 +1227,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||||||
// the current transformation matrix before the fillText/strokeText.
|
// the current transformation matrix before the fillText/strokeText.
|
||||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=726227
|
// See https://bugzilla.mozilla.org/show_bug.cgi?id=726227
|
||||||
var browserFontSize = size >= MIN_FONT_SIZE ? size : MIN_FONT_SIZE;
|
var browserFontSize = size >= MIN_FONT_SIZE ? size : MIN_FONT_SIZE;
|
||||||
this.current.fontSizeScale = browserFontSize != MIN_FONT_SIZE ? 1.0 :
|
this.current.fontSizeScale = browserFontSize !== MIN_FONT_SIZE ? 1.0 :
|
||||||
size / MIN_FONT_SIZE;
|
size / MIN_FONT_SIZE;
|
||||||
|
|
||||||
var rule = italic + ' ' + bold + ' ' + browserFontSize + 'px ' + typeface;
|
var rule = italic + ' ' + bold + ' ' + browserFontSize + 'px ' + typeface;
|
||||||
@ -1373,7 +1373,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||||||
lineWidth /= scale;
|
lineWidth /= scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fontSizeScale != 1.0) {
|
if (fontSizeScale !== 1.0) {
|
||||||
ctx.scale(fontSizeScale, fontSizeScale);
|
ctx.scale(fontSizeScale, fontSizeScale);
|
||||||
lineWidth /= fontSizeScale;
|
lineWidth /= fontSizeScale;
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,8 @@ var Metadata = PDFJS.Metadata = (function MetadataClosure() {
|
|||||||
var chars = '';
|
var chars = '';
|
||||||
for (var i = 0; i < bytes.length; i += 2) {
|
for (var i = 0; i < bytes.length; i += 2) {
|
||||||
var code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1);
|
var code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1);
|
||||||
chars += code >= 32 && code < 127 && code != 60 && code != 62 &&
|
chars += code >= 32 && code < 127 && code !== 60 && code !== 62 &&
|
||||||
code != 38 && false ? String.fromCharCode(code) :
|
code !== 38 && false ? String.fromCharCode(code) :
|
||||||
'&#x' + (0x10000 + code).toString(16).substring(1) + ';';
|
'&#x' + (0x10000 + code).toString(16).substring(1) + ';';
|
||||||
}
|
}
|
||||||
return '>' + chars;
|
return '>' + chars;
|
||||||
|
@ -382,7 +382,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) {
|
clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) {
|
||||||
if (bbox && isArray(bbox) && 4 == bbox.length) {
|
if (bbox && isArray(bbox) && bbox.length === 4) {
|
||||||
var bboxWidth = x1 - x0;
|
var bboxWidth = x1 - x0;
|
||||||
var bboxHeight = y1 - y0;
|
var bboxHeight = y1 - y0;
|
||||||
graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);
|
graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);
|
||||||
|
@ -162,7 +162,7 @@ var SVGGraphics = (function SVGGraphicsClosure(ctx) {
|
|||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
for (var i = 0; i < fnArrayLen; i++) {
|
for (var i = 0; i < fnArrayLen; i++) {
|
||||||
if (OPS.dependency == fnArray[i]) {
|
if (OPS.dependency === fnArray[i]) {
|
||||||
var deps = argsArray[i];
|
var deps = argsArray[i];
|
||||||
for (var n = 0, nn = deps.length; n < nn; n++) {
|
for (var n = 0, nn = deps.length; n < nn; n++) {
|
||||||
var obj = deps[n];
|
var obj = deps[n];
|
||||||
@ -652,7 +652,7 @@ var SVGGraphics = (function SVGGraphicsClosure(ctx) {
|
|||||||
this.clippath = document.createElementNS(NS, 'svg:clipPath');
|
this.clippath = document.createElementNS(NS, 'svg:clipPath');
|
||||||
this.clippath.setAttributeNS(null, 'id', current.clipId);
|
this.clippath.setAttributeNS(null, 'id', current.clipId);
|
||||||
var clipElement = current.element.cloneNode();
|
var clipElement = current.element.cloneNode();
|
||||||
if (type == 'evenodd') {
|
if (type === 'evenodd') {
|
||||||
clipElement.setAttributeNS(null, 'clip-rule', 'evenodd');
|
clipElement.setAttributeNS(null, 'clip-rule', 'evenodd');
|
||||||
} else {
|
} else {
|
||||||
clipElement.setAttributeNS(null, 'clip-rule', 'nonzero');
|
clipElement.setAttributeNS(null, 'clip-rule', 'nonzero');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user