From 610cec6e72aeffa40060f84ad7ff44f409c30e17 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sat, 27 Feb 2021 00:26:45 +0330 Subject: [PATCH] LibJS: Enable the BrowserExtended ECMA262 regexp flag by default Fixes #5517. --- Userland/Libraries/LibJS/Runtime/RegExpObject.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp index 2c1d28af9a..2bcd12bf05 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp @@ -37,7 +37,9 @@ static Flags options_from(const String& flags, VM& vm, GlobalObject& global_obje { bool g = false, i = false, m = false, s = false, u = false, y = false; Flags options { - { (regex::ECMAScriptFlags)regex::AllFlags::Global }, // JS regexps are all 'global' by default as per our definition, but the "global" flag enables "stateful". + // JS regexps are all 'global' by default as per our definition, but the "global" flag enables "stateful". + // FIXME: Enable 'BrowserExtended' only if in a browser context. + { (regex::ECMAScriptFlags)regex::AllFlags::Global | ECMAScriptFlags::BrowserExtended }, {}, };