mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +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:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user