mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
LibJS: Pass prototype to StringObject constructor
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 07:31:41 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/298c6062000
@@ -57,7 +57,9 @@ Value StringConstructor::construct(Interpreter& interpreter)
|
||||
primitive_string = js_string(interpreter, "");
|
||||
else
|
||||
primitive_string = js_string(interpreter, interpreter.argument(0).to_string());
|
||||
return Value(interpreter.heap().allocate<StringObject>(primitive_string));
|
||||
if (!primitive_string)
|
||||
return {};
|
||||
return StringObject::create(interpreter.global_object(), *primitive_string);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user