1
Fork 0
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:
Linus Groh 2023-02-11 16:14:41 +00:00
parent 5e72fde954
commit a8bf2f8e4c
11 changed files with 27 additions and 27 deletions

View file

@ -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));
}