1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +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

@ -148,13 +148,13 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::raw)
auto substitution_count = vm.argument_count() > 0 ? vm.argument_count() - 1 : 0;
// 2. Let cooked be ? ToObject(template).
auto* cooked = TRY(template_.to_object(vm));
auto cooked = TRY(template_.to_object(vm));
// 3. Let literals be ? ToObject(? Get(cooked, "raw")).
auto* literals = TRY(TRY(cooked->get(vm.names.raw)).to_object(vm));
auto literals = TRY(TRY(cooked->get(vm.names.raw)).to_object(vm));
// 4. Let literalCount be ? LengthOfArrayLike(literals).
auto literal_count = TRY(length_of_array_like(vm, *literals));
auto literal_count = TRY(length_of_array_like(vm, literals));
// 5. If literalCount ≤ 0, return the empty String.
if (literal_count == 0)