ericcornelissen / ericcornelissen/pp-runtime-gadgets
Errors when rewriting the `tc39/test262` suite
- Dominant language
- HTML
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Relates to #1 and #4
---
The [rewriter](https://github.com/ericcornelissen/pp-runtime-gadgets/blob/8194bd26cc0ee13bf5beaeb12a9f6567a38416bc/tc39/rewriter.js) for `tc39/test262` has some flaws and produces errors for some files. For example:
```log
error for ./test/built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFKD-negated.js: Invalid regular expression: /\P{Expands_On_NFKD}/: Invalid property name (18:1)
SyntaxError: Invalid regular expression: /\P{Expands_On_NFKD}/: Invalid property name (18:1)
at pp$4.raise (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:3567:13)
at RegExpValidationState.raise (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:3841:15)
at pp$1.regexp_validateUnicodePropertyNameOrValue (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:4652:9)
at pp$1.regexp_eatUnicodePropertyValueExpression (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:4637:17)
at pp$1.regexp_eatCharacterClassEscape (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:4594:22)
at pp$1.regexp_eatAtomEscape (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:4362:10)
at pp$1.regexp_eatReverseSolidusAtomEscape (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:4148:14)
at pp$1.regexp_eatAtom (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:4139:10)
at pp$1.regexp_eatTerm (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:4043:28)
at pp$1.regexp_alternative (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:4024:50) {
pos: 473,
loc: Position { line: 18, column: 1 },
raisedAt: 494
}
```
or
```log
error for ./test/built-ins/ShadowRealm/prototype/importValue/import-value_syntax_error_FIXTURE.js: Unexpected token (4:5)
SyntaxError: Unexpected token (4:5)
at pp$4.raise (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:3567:13)
at pp$9.unexpected (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:766:8)
at pp$9.semicolon (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:743:66)
at pp$8.parseExpressionStatement (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:1232:8)
at pp$8.parseStatement (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:959:24)
at pp$8.parseTopLevel (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:823:21)
at Parser.parse (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:595:15)
at Function.parse (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:645:35)
at Module.parse (file://.../pp-runtime-gadgets/tc39/node_modules/acorn/dist/acorn.mjs:5955:17)
at transform (file://.../pp-runtime-gadgets/tc39/rewriter.js:51:20) {
pos: 135,
loc: Position { line: 4, column: 5 },
raisedAt: 137
}
```
(at first glance, these seem to be the only two types of errors.)
A full log of the rewriter operating on `tc39/test262` on commit 53c21d460dc1ac447f618b291c8846e5a9b21fce is available here: [rewrite_log.txt](https://github.com/user-attachments/files/17465589/rewrite_log.txt)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.