Skip to content

🐛 fix(js): stop folding legacy octal as decimal - #2528

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/js-legacy-octal-fold
Nov 20, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/js-legacy-octal-fold

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

minify_js() folded arithmetic over a legacy octal literal as if its digits were decimal:

x=010*2   // node: 16; main's output: x=20

int_value now refuses any integer literal with a leading zero followed by more digits: a legacy octal (010 is 8) and a leading-zero decimal (08) both stay as written. Plain decimal folding is unchanged.

int_value read a literal's digits as decimal, so 010*2 folded to 20 where
the engine evaluates 16. A literal with a leading zero and more digits is
either a legacy octal or a leading-zero decimal; neither folds now.
@gaborbernat gaborbernat added the bug Something isn't working label Nov 20, 2026
@codspeed

codspeed Bot commented Nov 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 580 untouched benchmarks
⏩ 91 skipped benchmarks1


Comparing gaborbernat:fix/js-legacy-octal-fold (eae0bb8) with main (fb99191)

Open in CodSpeed

Footnotes

  1. 91 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@gaborbernat
gaborbernat merged commit cc736bb into tox-dev:main Nov 20, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant