1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:47:46 +00:00

LibJS: Port Value::to_object() to NonnullGCPtr

This commit is contained in:
Linus Groh 2023-04-13 15:26:41 +02:00 committed by Andreas Kling
parent e79f5b6e85
commit f345f72b55
29 changed files with 264 additions and 263 deletions

View file

@ -602,7 +602,7 @@ ThrowCompletionOr<Object*> coerce_options_to_object(VM& vm, Value options)
}
// 2. Return ? ToObject(options).
return TRY(options.to_object(vm));
return TRY(options.to_object(vm)).ptr();
}
// NOTE: 9.2.13 GetOption has been removed and is being pulled in from ECMA-262 in the Temporal proposal.

View file

@ -73,7 +73,7 @@ ThrowCompletionOr<Object*> to_date_time_options(VM& vm, Value options_value, Opt
auto& realm = *vm.current_realm();
// 1. If options is undefined, let options be null; otherwise let options be ? ToObject(options).
Object* options = nullptr;
GCPtr<Object> options;
if (!options_value.is_undefined())
options = TRY(options_value.to_object(vm));
@ -150,7 +150,7 @@ ThrowCompletionOr<Object*> to_date_time_options(VM& vm, Value options_value, Opt
}
// 13. Return options.
return options;
return options.ptr();
}
// 11.5.2 DateTimeStyleFormat ( dateStyle, timeStyle, styles ), https://tc39.es/ecma402/#sec-date-time-style-format