mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Remove variable shadowing from the JavaScript files in the src/core/
folder
*This is part of a series of patches that will try to split PR 11566 into smaller chunks, to make reviewing more feasible.* Once all the code has been fixed, we'll be able to eventually enable the ESLint no-shadow rule; see https://eslint.org/docs/rules/no-shadow
This commit is contained in:
parent
b86df97725
commit
216cbca16c
11 changed files with 135 additions and 140 deletions
|
@ -55,8 +55,8 @@ function toNumberArray(arr) {
|
|||
if (typeof arr[i] !== "number") {
|
||||
// Non-number is found -- convert all items to numbers.
|
||||
const result = new Array(length);
|
||||
for (let i = 0; i < length; i++) {
|
||||
result[i] = +arr[i];
|
||||
for (let j = 0; j < length; j++) {
|
||||
result[j] = +arr[j];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -1088,18 +1088,17 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
|
|||
PostScriptCompiler.prototype = {
|
||||
compile: function PostScriptCompiler_compile(code, domain, range) {
|
||||
var stack = [];
|
||||
var i, ii;
|
||||
var instructions = [];
|
||||
var inputSize = domain.length >> 1,
|
||||
outputSize = range.length >> 1;
|
||||
var lastRegister = 0;
|
||||
var n, j;
|
||||
var num1, num2, ast1, ast2, tmpVar, item;
|
||||
for (i = 0; i < inputSize; i++) {
|
||||
for (let i = 0; i < inputSize; i++) {
|
||||
stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1]));
|
||||
}
|
||||
|
||||
for (i = 0, ii = code.length; i < ii; i++) {
|
||||
for (let i = 0, ii = code.length; i < ii; i++) {
|
||||
item = code[i];
|
||||
if (typeof item === "number") {
|
||||
stack.push(new AstLiteral(item));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue