From db00097700c31902aa536a7f64dfe23532f14c25 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 19 Nov 2022 12:47:48 +0000 Subject: [PATCH] LibJS: Match spec behaviour in TypedArray.prototype.join This corrects 2 TRYs to MUSTs and a replaces a call to is_nullish to is_undefined. --- Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp index c651542ab3..6c72c2d8e6 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp @@ -761,12 +761,12 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::join) builder.append(separator); // b. Let element be ! Get(O, ! ToString(𝔽(k))). - auto element = TRY(typed_array->get(i)); + auto element = MUST(typed_array->get(i)); // c. If element is undefined, let next be the empty String; otherwise, let next be ! ToString(element). - if (element.is_nullish()) + if (element.is_undefined()) continue; - auto next = TRY(element.to_string(vm)); + auto next = MUST(element.to_string(vm)); // d. Set R to the string-concatenation of R and next. builder.append(next);