mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Use more for...of
loops in the code-base
Note that these cases, which are all in older code, were found using the [`unicorn/no-for-loop`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md) ESLint plugin rule. However, note that I've opted not to enable this rule by default since there's still *some* cases where I do think that it makes sense to allow "regular" for-loops.
This commit is contained in:
parent
5bfba89b0a
commit
37ebc28756
14 changed files with 35 additions and 50 deletions
|
@ -416,10 +416,10 @@ describe("function", function () {
|
|||
"destOffset",
|
||||
compiledCode
|
||||
);
|
||||
for (let i = 0; i < samples.length; i++) {
|
||||
const out = new Float32Array(samples[i].output.length);
|
||||
fn(samples[i].input, 0, out, 0);
|
||||
expect(Array.prototype.slice.call(out, 0)).toEqual(samples[i].output);
|
||||
for (const { input, output } of samples) {
|
||||
const out = new Float32Array(output.length);
|
||||
fn(input, 0, out, 0);
|
||||
expect(Array.prototype.slice.call(out, 0)).toEqual(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue