mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
LibJS: Fix flags check in regexp_create()
We need to check for undefined, not empty - otherwise it will literally use "undefined" as the flags, which will fail (Invalid RegExp flag 'n').
This commit is contained in:
parent
6d2d8d091f
commit
32052b3198
1 changed files with 1 additions and 1 deletions
|
@ -180,7 +180,7 @@ RegExpObject* regexp_create(GlobalObject& global_object, Value pattern, Value fl
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
String f;
|
String f;
|
||||||
if (flags.is_empty()) {
|
if (flags.is_undefined()) {
|
||||||
f = String::empty();
|
f = String::empty();
|
||||||
} else {
|
} else {
|
||||||
f = flags.to_string(global_object);
|
f = flags.to_string(global_object);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue