Skip to content

Fix ReferenceError in upload size check and implicit global in level adapter - #1434

Open
mikeua wants to merge 1 commit into
amark:masterfrom
mikeua:fix-upload-file-ref
Open

mikeua wants to merge 1 commit into
amark:masterfrom
mikeua:fix-upload-file-ref

Conversation

@mikeua

@mikeua mikeua commented Oct 6, 2026

Copy link
Copy Markdown

Two small bugs found with eslint --rule no-undef:

  • lib/upload.js: when a dropped file is larger than opt.max, the error callback does file: file[i], but the variable is files. Instead of calling cb({err: "File size is too large."}), it throws ReferenceError: file is not defined. Changed to files[i].
  • lib/level.js: soul is assigned in the get handler without being declared, so it leaks as an implicit global (and throws in strict mode / ESM bundles). Declared it alongside lex.

…adapter

- lib/upload.js: when a file exceeds opt.max, the error callback
  referenced the undefined variable 'file' instead of 'files', so it
  threw a ReferenceError instead of reporting 'File size is too large.'
- lib/level.js: 'soul' was assigned without a declaration, leaking an
  implicit global (and throwing in strict mode).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant