diff options
Diffstat (limited to 'ext/webidl/00_webidl.js')
-rw-r--r-- | ext/webidl/00_webidl.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/webidl/00_webidl.js b/ext/webidl/00_webidl.js index 46d0a2c1d..124c81c73 100644 --- a/ext/webidl/00_webidl.js +++ b/ext/webidl/00_webidl.js @@ -58,6 +58,7 @@ const { ReflectHas, ReflectOwnKeys, RegExpPrototypeTest, + SafeRegExp, Set, SetPrototypeEntries, SetPrototypeForEach, @@ -386,7 +387,7 @@ converters.DOMString = function (V, opts = {}) { }; // deno-lint-ignore no-control-regex -const IS_BYTE_STRING = /^[\x00-\xFF]*$/; +const IS_BYTE_STRING = new SafeRegExp(/^[\x00-\xFF]*$/); converters.ByteString = (V, opts) => { const x = converters.DOMString(V, opts); if (!RegExpPrototypeTest(IS_BYTE_STRING, x)) { @@ -500,7 +501,9 @@ ArrayPrototypeForEach( ], (func) => { const name = func.name; - const article = RegExpPrototypeTest(/^[AEIOU]/, name) ? "an" : "a"; + const article = RegExpPrototypeTest(new SafeRegExp(/^[AEIOU]/), name) + ? "an" + : "a"; converters[name] = (V, opts = {}) => { if (TypedArrayPrototypeGetSymbolToStringTag(V) !== name) { throw makeException( |