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
Notes:
sideshowbarker
2024-07-18 21:22:32 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/32052b3198c Pull-request: https://github.com/SerenityOS/serenity/pull/5781
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
Reference in a new issue