Regression Test for RangeError Crash #59594
Labels
Help Wanted
You can do this
Possible Improvement
The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
🔎 Search Terms
RangeError regression test
🕗 Version & Regression Information
Somewhat unconventionally this particular issue was actually already fixed in 71fb864 but it's broken before c8a7d58. It shows up in TypeScript 5.5.4 but not TypeScript 5.4
I'm only still reporting this issue because it doesn't look like the commit that happened to fix it contained any regression tests for this crash or anything. As far as I can tell the fact that this crash was fixed by complete chance and I want to make sure that this doesn't happen again.
⏯ Playground Link
No response
💻 Code
This doesn't seem to crash in the Playground, presumably because it resolves differently than tsc and avoids the RangeError, but maybe I messed something up.
TSConfig:
Minimal reproduction JavaScript file (run with
checkJS
):I managed to take a much larger file and reduce it using
CReduce
, hence why it's so contrived. However this happened in the real world, I became aware of this while helping out with peggyjs/peggy#538. The full file causing the error is this: https://github.com/peggyjs/peggy/blob/4036dabd40bdb318876ba0f3ac6fd5b0ae317176/lib/parser.jsAlternatively use the zipped reproduction project - to reproduce run
npm install
and then./node_modules/typescript/bin/tsc
.When I run with TypeScript == 5.5.4 this crashes, though on TypeScript@main it doesn't so as already mentioned it's already been fixed. This is the traceback:
Terminal session running the reproduction:
🙁 Actual behavior
This (used to) crash and doesn't seem to have a regression test.
🙂 Expected behavior
No crash
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: