mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
LibJS: Port Symbol to String
This includes the VM's global_symbol_registry HashMap, which can now store String keys.
This commit is contained in:
parent
5e72fde954
commit
a8bf2f8e4c
11 changed files with 27 additions and 27 deletions
|
@ -47,7 +47,7 @@ ThrowCompletionOr<Value> StringConstructor::call()
|
|||
if (!vm.argument_count())
|
||||
return PrimitiveString::create(vm, String {});
|
||||
if (vm.argument(0).is_symbol())
|
||||
return PrimitiveString::create(vm, vm.argument(0).as_symbol().descriptive_string());
|
||||
return PrimitiveString::create(vm, TRY_OR_THROW_OOM(vm, vm.argument(0).as_symbol().descriptive_string()));
|
||||
return TRY(vm.argument(0).to_primitive_string(vm));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue