oxc/tasks/coverage
Dunqing c59d8b3c9b feat(transformer): support all /regex/ to new RegExp transforms (#5387)
related: #4754

The implementation port from [esbuild](332727499e/internal/js_parser/js_parser.go (L12820-L12840)). And cover all babel's regexp plugins

---

## The following description was generated by `Graphite` 😋

### TL;DR

Added support for transforming various RegExp features to ensure compatibility with older JavaScript environments.

### What changed?

- Implemented a new `RegExp` transformer to handle unsupported RegExp literal features
- Added options to control different RegExp transformations (e.g., sticky flag, unicode flag, dot-all flag, etc.)
- Updated the transformer to convert unsupported RegExp literals into `new RegExp()` constructor calls
- Added test cases for different RegExp transformations
- Integrated the new RegExp transformer into the existing transformation pipeline

### How to test?

1. Run the existing test suite to ensure no regressions
2. Execute the new RegExp-specific tests in the `tasks/transform_conformance/tests/esbuild-tests/test/fixtures/regexp/` directory
3. Try transforming code with various RegExp features using different target environments to verify correct transformations
2024-09-05 11:04:45 +00:00
..
misc feat(parser): add syntax error for hyphen in JSXMemberExpression <Foo.bar-baz /> (#5440) 2024-09-04 14:09:06 +00:00
src feat(semantic): transform checker check child scope IDs (#5410) 2024-09-03 00:57:13 +00:00
Cargo.toml
codegen_babel.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
codegen_misc.snap
codegen_runtime_test262.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
codegen_sourcemap.snap feat(codegen): print missing fields for AccessorProperty (#5291) 2024-08-28 08:42:39 +00:00
codegen_test262.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
codegen_typescript.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
minifier_babel.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
minifier_test262.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
parser_babel.snap feat(semantic): check for non-declared, non-abstract class accessors without bodies (#5460) 2024-09-05 01:33:09 +00:00
parser_misc.snap feat(parser): add syntax error for hyphen in JSXMemberExpression <Foo.bar-baz /> (#5440) 2024-09-04 14:09:06 +00:00
parser_test262.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
parser_typescript.snap feat(semantic): check for initializers in ambient VariableDeclarations (#5463) 2024-09-05 01:33:11 +00:00
prettier_babel.snap
prettier_misc.snap
prettier_test262.snap
prettier_typescript.snap
README.md
semantic_babel.snap feat(semantic): transform checker check child scope IDs (#5410) 2024-09-03 00:57:13 +00:00
semantic_misc.snap feat(semantic): transform checker check child scope IDs (#5410) 2024-09-03 00:57:13 +00:00
semantic_test262.snap feat(semantic): transform checker check child scope IDs (#5410) 2024-09-03 00:57:13 +00:00
semantic_typescript.snap feat(transformer): support all /regex/ to new RegExp transforms (#5387) 2024-09-05 11:04:45 +00:00
transformer_babel.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
transformer_misc.snap
transformer_test262.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
transformer_typescript.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
transpile.snap chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00

Coverage

Tools are tested against test262, babel and TypeScript for conformance.

Clone the test repositories beforehand:

just submodules

Development

# full run
cargo coverage
cargo coverage js # for test262
cargo coverage babel # for babel
cargo coverage ts # for typescript

# run in watch
cargo watch -x 'coverage js'

# filter for a file path
cargo watch -x 'coverage js --filter filter-file-path'

# find crash scene by turning off rayon and print out the test cases in serial
cargo coverage -- --debug

# Run after submodules are updated
UPDATE_SNAPSHOT=1 just c