Skip to content

Conversation

@oxe-i
Copy link
Contributor

@oxe-i oxe-i commented Jul 21, 2025

Files for a failing test to the Forth exercise, with a results.json (renamed as expected_results.json) and the files for the exercise.

@oxe-i oxe-i requested a review from a team as a code owner July 21, 2025 00:35
@github-actions

This comment was marked as resolved.

@github-actions github-actions bot closed this Jul 21, 2025
@oxe-i
Copy link
Contributor Author

oxe-i commented Jul 21, 2025

@SleeplessByte as discussed in the forum

@oxe-i
Copy link
Contributor Author

oxe-i commented Jul 21, 2025

I believe the problem is in RegExp.escape

@Cool-Katt Cool-Katt reopened this Jul 21, 2025
@SleeplessByte
Copy link
Member

I believe the problem is in RegExp.escape

Compatibility table for RegExp.escape, indicating Node 24 minimum requirement

You're expectation is correct. This is not supported before Node 24.

Download dropdown with the current node version marked as 24 and the LTS node version marked as 22

The current LTS (long term support) is 22, which is what we support officially. That also means that we would expect this to fail for you using the CLI and not the browser (as discussed on the forum).

We can leave this PR open and merge it when LTS moves to 24, later this year:

The current LTS release schema indicating Node 24 will become LTS near the end of 2025

@oxe-i
Copy link
Contributor Author

oxe-i commented Jul 21, 2025

That's a bit odd. My machine here says I'm using Node v.22.16 and, when I open the REPL and try RegExp.escape it gives me an error. However corepack pnpm test gives me a pass to all tests.

Screenshot from 2025-07-21 10-34-14

@oxe-i
Copy link
Contributor Author

oxe-i commented Jul 21, 2025

It seems there's an internal RegExp.escape implemented in a module inside core-js folder. When I check definition for the function in VSCode, it directs me to an internal interface in TypeScript that exists since ECMAScript 7. And when I check the folder for the exercise, there's a node_modules/.pnpm/core-js@3.42.0/node_modules/core-js/modules/es.regexp.escape.js with the actual code for the function:

Screenshot from 2025-07-21 11-16-27

It seems I inadvertently have fallen into quite a rabbit hole! What a coincidence!

@SleeplessByte
Copy link
Member

SleeplessByte commented Jul 21, 2025

Yeah, we use it when you run it locally! Check out https://github.com/exercism/babel-preset-javascript/blob/main/index.cjs#L11 which loads core-js during regular use.

I thought we set-up this test-runner to use the same, but it seems to not do that? Imma try out to update the test-runner, and then we can merge in that update here and see if that makes it work.

edit: yeah we do, but we were running 3.38 instead of 3.44

@SleeplessByte
Copy link
Member

More data:

version 3.41 through 3.44

We were running polyfill 3.38, but now that I bumped it to '3.44', it runs fine.

I generated results.json for your solution, so we can merge it.

@SleeplessByte SleeplessByte merged commit 53a0ca3 into exercism:main Jul 21, 2025
6 checks passed
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.

3 participants