Implement full RegExp support using the `regress` crate for ECMAScript-compatible regex semantics. This includes parser-driven regex literal disambiguation, RegExp constructor, prototype methods (test, exec, toString), and String method integration (match, search, replace, split with regex args). Key implementation details: - Parser rescans source from `/` in expression-start position via scan_regexp() - RegExpData stored as PrimitiveValue internal slot on JsObject - Flags sorted in canonical ECMAScript order (d g i m s u v y) - NativeFn signature upgraded to return Result for proper error propagation - Unicode-safe: char_indices iteration in scanner, char-based offset conversion for exec().index, search(), and lastIndex - $-substitution patterns in replace ($&, $$, $`, $', $n, $nn) 92 unit tests covering parsing, properties, test/exec/constructor, toString, String method integration, and error cases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
14 lines
217 B
TOML
14 lines
217 B
TOML
[package]
|
|
name = "js_vm"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
js_parser = { path = "../js_parser" }
|
|
regress.workspace = true
|
|
thiserror.workspace = true
|
|
tracing.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|