Add RegExp.escape static method#252
Conversation
- Implement the TC39 RegExp Escaping proposal on RegExp - Add end-to-end coverage and document the new static method
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request adds the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Benchmark Results274 benchmarks Interpreted: 🟢 220 improved · 🔴 7 regressed · 47 unchanged · avg +7.0% arraybuffer.js — Interp: 🟢 12, 🔴 1, 1 unch. · avg +9.1% · Bytecode: 🟢 1, 🔴 6, 7 unch. · avg -1.2%
arrays.js — Interp: 🟢 19 · avg +8.9% · Bytecode: 🟢 3, 🔴 8, 8 unch. · avg -0.5%
async-await.js — Interp: 🟢 6 · avg +8.6% · Bytecode: 🟢 1, 🔴 1, 4 unch. · avg -0.5%
classes.js — Interp: 🟢 25, 6 unch. · avg +6.2% · Bytecode: 🟢 10, 21 unch. · avg +1.7%
closures.js — Interp: 🟢 10, 1 unch. · avg +10.5% · Bytecode: 🟢 4, 🔴 1, 6 unch. · avg +1.9%
collections.js — Interp: 🟢 9, 3 unch. · avg +13.8% · Bytecode: 🟢 6, 🔴 5, 1 unch. · avg +0.4%
destructuring.js — Interp: 🟢 17, 5 unch. · avg +6.5% · Bytecode: 🟢 13, 9 unch. · avg +2.5%
fibonacci.js — Interp: 🟢 7, 1 unch. · avg +10.5% · Bytecode: 🟢 4, 🔴 2, 2 unch. · avg +1.3%
for-of.js — Interp: 🟢 4, 3 unch. · avg +4.8% · Bytecode: 🟢 5, 2 unch. · avg +3.3%
helpers/bench-module.js — Interp: 0 · Bytecode: 0
iterators.js — Interp: 🟢 18, 2 unch. · avg +7.4% · Bytecode: 🟢 4, 🔴 4, 12 unch. · avg +0.5%
json.js — Interp: 🟢 19, 1 unch. · avg +9.1% · Bytecode: 🟢 6, 🔴 2, 12 unch. · avg +0.4%
jsx.jsx — Interp: 🟢 4, 17 unch. · avg +0.6% · Bytecode: 🟢 15, 6 unch. · avg +2.4%
modules.js — Interp: 🟢 9 · avg +7.6% · Bytecode: 🟢 2, 🔴 7 · avg -2.5%
numbers.js — Interp: 🟢 11 · avg +8.8% · Bytecode: 🟢 2, 🔴 3, 6 unch. · avg -0.2%
objects.js — Interp: 🟢 1, 🔴 2, 4 unch. · avg -1.3% · Bytecode: 🟢 1, 🔴 3, 3 unch. · avg -0.6%
promises.js — Interp: 🟢 11, 1 unch. · avg +5.1% · Bytecode: 🔴 3, 9 unch. · avg -0.9%
regexp.js — Interp: 🟢 11 · avg +6.7% · Bytecode: 🔴 3, 8 unch. · avg -1.1%
strings.js — Interp: 🟢 11 · avg +9.9% · Bytecode: 🔴 9, 2 unch. · avg -1.7%
typed-arrays.js — Interp: 🟢 16, 🔴 4, 2 unch. · avg +4.1% · Bytecode: 🔴 15, 7 unch. · avg -2.2%
Measured on ubuntu-latest x64. Benchmark ranges compare cached main-branch min/max ops/sec with the PR run; overlapping ranges are treated as unchanged noise. Percentage deltas are secondary context. |
Suite Timing
Measured on ubuntu-latest x64. |
Summary
RegExp.escape(string)as a staticRegExpmethod, following the TC39 RegExp Escaping proposal.Testing
./build.pas testrunner && ./build/TestRunner teststests/built-ins/RegExp/escape.jscoverage for syntax characters, whitespace, class-set punctuators, and first-character rules./build.pas clean tests && for t in build/Goccia.*.Test; do "$t"; done)