mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
This patch integrates spidermonkey regex into urlpattern crate so the URLPattern API uses EcmaScript regex instead of rust's regex. The dom URLPattern holds onto an opaque pointer to the urlpattern::URLPattern<R> from the crates lib.rs. Where we implement SpiderMonkeyRegexp for RegExp (R). We use an ffi api to access SpiderMonkey parsing for pattern construction and exec for matching. During parsing, SpiderMonkey produces a regexp object that can be held by our SpiderMonkeyRegExp, which is kept alive ultimately by the dom's URLPattern. It's a bit clunky because Spidermonkey works with UTF-16, while our WebAPI and rust works with UTF-8 but it seems to work. Also I got rid of some unnecessary Urlp types and their associated funcions and tests by using more opaque pointers. Differential Revision: https://phabricator.services.mozilla.com/D278548