Issue #2008 - Fix lint errors for src/jbig2.js
This commit is contained in:
parent
f883a1f40f
commit
bc94a4d353
21
src/jbig2.js
21
src/jbig2.js
@ -1,5 +1,6 @@
|
||||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
|
||||
/* globals error, shadow */
|
||||
/* Copyright 2012 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -123,7 +124,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
||||
return d;
|
||||
} else {
|
||||
this.chigh -= qeIcx;
|
||||
if ((this.a & 0x8000) == 0) {
|
||||
if ((this.a & 0x8000) === 0) {
|
||||
var d = this.exchangeMps(cx);
|
||||
this.renormD();
|
||||
return d;
|
||||
@ -134,14 +135,14 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
||||
},
|
||||
renormD: function ArithmeticDecoder_renormD() {
|
||||
do {
|
||||
if (this.ct == 0)
|
||||
if (this.ct === 0)
|
||||
this.byteIn();
|
||||
|
||||
this.a <<= 1;
|
||||
this.chigh = ((this.chigh << 1) & 0xFFFF) | ((this.clow >> 15) & 1);
|
||||
this.clow = (this.clow << 1) & 0xFFFF;
|
||||
this.ct--;
|
||||
} while ((this.a & 0x8000) == 0);
|
||||
} while ((this.a & 0x8000) === 0);
|
||||
},
|
||||
exchangeMps: function ArithmeticDecoder_exchangeMps(cx) {
|
||||
var d;
|
||||
@ -261,7 +262,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
||||
break;
|
||||
default:
|
||||
v = v * 2 + bit;
|
||||
if (--toRead == 0)
|
||||
if (--toRead === 0)
|
||||
state = 0;
|
||||
continue;
|
||||
}
|
||||
@ -437,7 +438,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
||||
offsetX, offsetY, prediction, at,
|
||||
decodingContext) {
|
||||
var codingTemplate = RefinementTemplates[templateIndex].coding;
|
||||
if (templateIndex == 0)
|
||||
if (templateIndex === 0)
|
||||
codingTemplate = codingTemplate.concat([at[0]]);
|
||||
var codingTemplateLength = codingTemplate.length;
|
||||
var codingTemplateX = new Int32Array(codingTemplateLength);
|
||||
@ -447,7 +448,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
||||
codingTemplateY[k] = codingTemplate[k].y;
|
||||
}
|
||||
var referenceTemplate = RefinementTemplates[templateIndex].reference;
|
||||
if (templateIndex == 0)
|
||||
if (templateIndex === 0)
|
||||
referenceTemplate = referenceTemplate.concat([at[1]]);
|
||||
var referenceTemplateLength = referenceTemplate.length;
|
||||
var referenceTemplateX = new Int32Array(referenceTemplateLength);
|
||||
@ -530,7 +531,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
||||
var totalWidth = 0;
|
||||
while (true) {
|
||||
var deltaWidth = decodeInteger(contextCache, 'IADW', decoder); // 6.5.7
|
||||
if (deltaWidth == null)
|
||||
if (deltaWidth === null)
|
||||
break; // OOB
|
||||
currentWidth += deltaWidth;
|
||||
totalWidth += currentWidth;
|
||||
@ -657,7 +658,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
||||
i++;
|
||||
|
||||
var deltaS = decodeInteger(contextCache, 'IADS', decoder); // 6.4.8
|
||||
if (deltaS == null)
|
||||
if (deltaS === null)
|
||||
break; // OOB
|
||||
currentS += deltaS + dsOffset;
|
||||
} while (true);
|
||||
@ -779,7 +780,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
||||
dictionary.refinementTemplate = (dictionaryFlags >> 12) & 1;
|
||||
position += 2;
|
||||
if (!dictionary.huffman) {
|
||||
var atLength = dictionary.template == 0 ? 4 : 1;
|
||||
var atLength = dictionary.template === 0 ? 4 : 1;
|
||||
var at = [];
|
||||
for (var i = 0; i < atLength; i++) {
|
||||
at.push({
|
||||
@ -865,7 +866,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
||||
genericRegion.template = (genericRegionSegmentFlags >> 1) & 3;
|
||||
genericRegion.prediction = !!(genericRegionSegmentFlags & 8);
|
||||
if (!genericRegion.mmr) {
|
||||
var atLength = genericRegion.template == 0 ? 4 : 1;
|
||||
var atLength = genericRegion.template === 0 ? 4 : 1;
|
||||
var at = [];
|
||||
for (var i = 0; i < atLength; i++) {
|
||||
at.push({
|
||||
|
Loading…
Reference in New Issue
Block a user