mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Replace *most* cases of var
with let
/const
in the external/builder/
folder
These changes were done automatically, by using the `gulp lint --fix` command, in preparation for the next patch.
This commit is contained in:
parent
fb78604383
commit
06494ccdac
4 changed files with 77 additions and 77 deletions
26
external/builder/test-fixtures_esprima.js
vendored
26
external/builder/test-fixtures_esprima.js
vendored
|
@ -1,13 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
var p2 = require("./preprocessor2.js");
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
const p2 = require("./preprocessor2.js");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
var errors = 0;
|
||||
let errors = 0;
|
||||
|
||||
var baseDir = path.join(__dirname, "fixtures_esprima");
|
||||
var files = fs
|
||||
const baseDir = path.join(__dirname, "fixtures_esprima");
|
||||
const files = fs
|
||||
.readdirSync(baseDir)
|
||||
.filter(function (name) {
|
||||
return /-expected\./.test(name);
|
||||
|
@ -16,29 +16,29 @@ var files = fs
|
|||
return path.join(baseDir, name);
|
||||
});
|
||||
files.forEach(function (expectationFilename) {
|
||||
var inFilename = expectationFilename.replace("-expected", "");
|
||||
var expectation = fs
|
||||
const inFilename = expectationFilename.replace("-expected", "");
|
||||
const expectation = fs
|
||||
.readFileSync(expectationFilename)
|
||||
.toString()
|
||||
.trim()
|
||||
.replace(/__filename/g, fs.realpathSync(inFilename));
|
||||
var input = fs.readFileSync(inFilename).toString();
|
||||
const input = fs.readFileSync(inFilename).toString();
|
||||
|
||||
var defines = {
|
||||
const defines = {
|
||||
TRUE: true,
|
||||
FALSE: false,
|
||||
OBJ: { obj: { i: 1 }, j: 2 },
|
||||
TEXT: "text",
|
||||
};
|
||||
var map = {
|
||||
const map = {
|
||||
"import-alias": "import-name",
|
||||
};
|
||||
var ctx = {
|
||||
const ctx = {
|
||||
defines,
|
||||
map,
|
||||
rootPath: __dirname + "/../..",
|
||||
};
|
||||
var out;
|
||||
let out;
|
||||
try {
|
||||
out = p2.preprocessPDFJSCode(ctx, input);
|
||||
} catch (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue