mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Enable unicorn/prefer-at
unconditionally (PR 15014 follow-up)
Now that Node.js version 18 is required, we should be able to use `Array.prototype.at()` everywhere in the code-base.
This commit is contained in:
parent
f79f48c2b4
commit
dcd55a7164
6 changed files with 7 additions and 16 deletions
4
external/builder/preprocessor2.js
vendored
4
external/builder/preprocessor2.js
vendored
|
@ -244,8 +244,8 @@ function postprocessNode(ctx, node) {
|
|||
const block = node.body;
|
||||
if (
|
||||
block.body.length > 0 &&
|
||||
block.body[block.body.length - 1].type === "ReturnStatement" &&
|
||||
!block.body[block.body.length - 1].argument
|
||||
block.body.at(-1).type === "ReturnStatement" &&
|
||||
!block.body.at(-1).argument
|
||||
) {
|
||||
// Function body ends with return without arg -- removing it.
|
||||
block.body.pop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue