mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +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;
|
||||
}
|
||||
String f;
|
||||
if (flags.is_empty()) {
|
||||
if (flags.is_undefined()) {
|
||||
f = String::empty();
|
||||
} else {
|
||||
f = flags.to_string(global_object);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue