mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibJS: Port (most of) String.prototype to String
The locations that haven't been ported have a much wider footprint than just the String.prototype files, so they've been left alone for now.
This commit is contained in:
parent
ceaec41726
commit
9f78e8728a
Notes:
sideshowbarker
2024-07-17 01:40:40 +09:00
Author: https://github.com/trflynn89
Commit: 9f78e8728a
Pull-request: https://github.com/SerenityOS/serenity/pull/17014
Reviewed-by: https://github.com/linusg ✅
6 changed files with 73 additions and 70 deletions
|
@ -43,7 +43,7 @@ ThrowCompletionOr<Value> StringConstructor::call()
|
|||
{
|
||||
auto& vm = this->vm();
|
||||
if (!vm.argument_count())
|
||||
return PrimitiveString::create(vm, "");
|
||||
return PrimitiveString::create(vm, String {});
|
||||
if (vm.argument(0).is_symbol())
|
||||
return PrimitiveString::create(vm, vm.argument(0).as_symbol().to_deprecated_string());
|
||||
return TRY(vm.argument(0).to_primitive_string(vm));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue