summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-02-27 00:26:45 +0330
committerAndreas Kling <kling@serenityos.org>2021-02-27 07:31:01 +0100
commit610cec6e72aeffa40060f84ad7ff44f409c30e17 (patch)
treede8835a9e3693ebe9da4d468157d69c501f062c5
parente0ac85288eddb690c555c2ffb2a1e0f2f4b6b565 (diff)
downloadserenity-610cec6e72aeffa40060f84ad7ff44f409c30e17.zip
LibJS: Enable the BrowserExtended ECMA262 regexp flag by default
Fixes #5517.
-rw-r--r--Userland/Libraries/LibJS/Runtime/RegExpObject.cpp4
1 files changed, 3 insertions, 1 deletions
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 },
{},
};