mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
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.
This commit is contained in:
parent
5341af6225
commit
db00097700
Notes:
sideshowbarker
2024-07-17 22:55:25 +09:00
Author: https://github.com/jamierocks Commit: https://github.com/SerenityOS/serenity/commit/db00097700 Pull-request: https://github.com/SerenityOS/serenity/pull/16117 Reviewed-by: https://github.com/linusg ✅
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue