1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-29 07:37:57 +02:00
pdf.js/src/core
Tim van der Meij 85659b4cf0
Enable the no-var linting rule in src/core/cmap.js
This is done automatically with `gulp lint --fix` and the following
manual changes:

```diff
diff --git a/src/core/cmap.js b/src/core/cmap.js
index 850275a19..8794726dd 100644
--- a/src/core/cmap.js
+++ b/src/core/cmap.js
@@ -519,8 +519,8 @@ const BinaryCMapReader = (function BinaryCMapReaderClosure() {

     readHexNumber(num, size) {
       let last;
-      let stack = this.tmpBuf,
-        sp = 0;
+      const stack = this.tmpBuf;
+      let sp = 0;
       do {
         const b = this.readByte();
         if (b < 0) {
@@ -603,7 +603,6 @@ const BinaryCMapReader = (function BinaryCMapReaderClosure() {

         const ucs2DataSize = 1;
         const subitemsCount = stream.readNumber();
-        var i;
         switch (type) {
           case 0: // codespacerange
             stream.readHex(start, dataSize);
@@ -614,7 +613,7 @@ const BinaryCMapReader = (function BinaryCMapReaderClosure() {
               hexToInt(start, dataSize),
               hexToInt(end, dataSize)
             );
-            for (i = 1; i < subitemsCount; i++) {
+            for (let i = 1; i < subitemsCount; i++) {
               incHex(end, dataSize);
               stream.readHexNumber(start, dataSize);
               addHex(start, end, dataSize);
@@ -633,7 +632,7 @@ const BinaryCMapReader = (function BinaryCMapReaderClosure() {
             addHex(end, start, dataSize);
             stream.readNumber(); // code
             // undefined range, skipping
-            for (i = 1; i < subitemsCount; i++) {
+            for (let i = 1; i < subitemsCount; i++) {
               incHex(end, dataSize);
               stream.readHexNumber(start, dataSize);
               addHex(start, end, dataSize);
@@ -647,7 +646,7 @@ const BinaryCMapReader = (function BinaryCMapReaderClosure() {
             stream.readHex(char, dataSize);
             code = stream.readNumber();
             cMap.mapOne(hexToInt(char, dataSize), code);
-            for (i = 1; i < subitemsCount; i++) {
+            for (let i = 1; i < subitemsCount; i++) {
               incHex(char, dataSize);
               if (!sequence) {
                 stream.readHexNumber(tmp, dataSize);
@@ -667,7 +666,7 @@ const BinaryCMapReader = (function BinaryCMapReaderClosure() {
               hexToInt(end, dataSize),
               code
             );
-            for (i = 1; i < subitemsCount; i++) {
+            for (let i = 1; i < subitemsCount; i++) {
               incHex(end, dataSize);
               if (!sequence) {
                 stream.readHexNumber(start, dataSize);
@@ -692,7 +691,7 @@ const BinaryCMapReader = (function BinaryCMapReaderClosure() {
               hexToInt(char, ucs2DataSize),
               hexToStr(charCode, dataSize)
             );
-            for (i = 1; i < subitemsCount; i++) {
+            for (let i = 1; i < subitemsCount; i++) {
               incHex(char, ucs2DataSize);
               if (!sequence) {
                 stream.readHexNumber(tmp, ucs2DataSize);
@@ -717,7 +716,7 @@ const BinaryCMapReader = (function BinaryCMapReaderClosure() {
               hexToInt(end, ucs2DataSize),
               hexToStr(charCode, dataSize)
             );
-            for (i = 1; i < subitemsCount; i++) {
+            for (let i = 1; i < subitemsCount; i++) {
               incHex(end, ucs2DataSize);
               if (!sequence) {
                 stream.readHexNumber(start, ucs2DataSize);
```
2021-04-25 17:40:00 +02:00
..
xfa XFA -- Display text content 2021-04-12 14:13:49 +02:00
.eslintrc Enable the ESLint no-var rule globally 2021-03-13 16:12:53 +01:00
annotation.js Rename the src/core/obj.js file to src/core/catalog.js 2021-04-13 21:00:30 +02:00
arithmetic_decoder.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
bidi.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
catalog.js Re-factor the Catalog._collectJavaScript method slightly 2021-04-23 09:42:32 +02:00
ccitt.js Enable the dot-notation ESLint rule 2020-04-17 12:24:46 +02:00
ccitt_stream.js Enable the no-var linting rule in src/core/ccitt_stream.js 2021-02-27 12:44:55 +01:00
cff_parser.js Set CFF header to 4 when writing it because it contains 4 elements (#13149) 2021-03-26 18:23:18 +01:00
charsets.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
chunked_stream.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
cmap.js Enable the no-var linting rule in src/core/cmap.js 2021-04-25 17:40:00 +02:00
colorspace.js Use Math.hypot, instead of Math.sqrt with manual squaring (#12973) 2021-02-10 12:28:49 +01:00
core_utils.js XFA -- Load fonts permanently from the pdf 2021-04-15 17:57:42 +02:00
crypto.js Convert code in src/core/crypto.js to use "normal" classes 2021-02-26 15:51:45 +01:00
default_appearance.js [api-minor] Change the format of the fontName-property, in defaultAppearanceData, on Annotation-instances (PR 12831 follow-up) 2021-04-01 16:47:30 +02:00
document.js Ensure that the /Properties, used with optional content, is actually loaded *before* parsing the operatorList/textContent (PR 12095 follow-up) 2021-04-20 20:22:44 +02:00
encodings.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
evaluator.js Replace a bunch of Array.prototype.forEach() cases with for...of loops instead 2021-04-24 13:00:19 +02:00
file_spec.js Enable the no-var rule in the src/core/file_spec.js file 2021-04-13 21:00:30 +02:00
font_renderer.js Enable the ESLint no-var rule in the src/core/font_renderer.js file 2021-03-12 11:57:27 +01:00
fonts.js For CFF fonts without proper ToUnicode/Encoding data, utilize the "charset"/"Encoding"-data from the font file to improve text-selection (issue 13260) 2021-04-20 20:48:44 +02:00
function.js Replace a bunch of Array.prototype.forEach() cases with for...of loops instead 2021-04-24 13:00:19 +02:00
glyphlist.js Enable the no-var linting rule in src/core/glyphlist.js 2021-02-27 12:46:57 +01:00
image.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
image_utils.js Ignore globally cached images in PartialEvaluator.getTextContent (PR 11930 follow-up) 2021-01-28 10:19:26 +01:00
jbig2.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
jbig2_stream.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
jpeg_stream.js [api-minor] Decode all JPEG images with the built-in PDF.js decoder in src/core/jpg.js 2020-05-22 00:22:48 +02:00
jpg.js Improve handling of JPEG images without an EOI marker (issue 12841) 2021-01-09 20:19:39 +01:00
jpx.js Ignore, rather than throwing on, unsupported Coding style default (COD) options in JPEG 2000 images (issue 11004) 2020-12-21 20:35:52 +01:00
jpx_stream.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
metadata_parser.js Move the XML-parser to the src/core/-folder 2021-02-17 13:12:01 +01:00
metrics.js Enable the no-var linting rule in src/core/metrics.js 2021-02-27 12:44:45 +01:00
murmurhash3.js Ensure that MurmurHash3_64.update handles ArrayBuffer input correctly, to avoid hash-collisions (issue 12533) 2020-10-26 16:27:33 +01:00
name_number_tree.js Change NameOrNumberTree.getAll to return a Map rather than an Object 2021-04-22 13:15:50 +02:00
object_loader.js Covert the ObjectLoader to a "normal" class 2021-04-13 21:00:30 +02:00
operator_list.js Enable the no-var linting rule for src/core/operator_list.js 2021-03-14 11:49:31 +01:00
parser.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
pattern.js Enable the no-var linting rule for src/core/pattern.js 2021-03-14 11:43:05 +01:00
pdf_manager.js XFA -- Load fonts permanently from the pdf 2021-04-15 17:57:42 +02:00
primitives.js Enable the no-var linting rule in src/core/primitives.js 2021-02-27 12:51:01 +01:00
ps_parser.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
standard_fonts.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
stream.js Skip extra objects in object stream in using offsets 2021-03-28 13:03:05 +02:00
struct_tree.js Move NameTree/NumberTree from src/core/obj.js and into its own file 2021-04-13 21:00:30 +02:00
type1_parser.js Convert code in src/core/type1_parser.js to use "standard" classes 2021-03-12 12:16:50 +01:00
unicode.js Use a buffer instead of string concatenation in reverseIfRtl in src/core/unicode.js 2021-02-27 13:20:09 +01:00
worker.js Replace a bunch of Array.prototype.forEach() cases with for...of loops instead 2021-04-24 13:00:19 +02:00
worker_stream.js Replace a bunch of Array.prototype.forEach() cases with for...of loops instead 2021-04-24 13:00:19 +02:00
writer.js Ensure that saveDocument works if there's no /ID-entry in the PDF document (issue 13279) (#13280) 2021-04-22 12:08:56 +02:00
xml_parser.js Move the encodeToXmlString helper function to src/core/core_utils.js 2021-02-17 13:12:01 +01:00
xref.js Enable the no-var rule in the src/core/xref.js file 2021-04-13 21:00:30 +02:00