Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -49562,6 +49562,24 @@ static JSValue js_typed_array_sort(JSContext *ctx, JSValue this_val,
return js_dup(this_val);
}

static JSValue js_typed_array_toSorted(JSContext *ctx, JSValue this_val,
int argc, JSValue *argv)
{
JSValue arr, ret;
JSObject *p;

p = get_typed_array(ctx, this_val, /*is_dataview*/0);
if (!p)
return JS_EXCEPTION;
arr = js_typed_array_constructor_ta(ctx, JS_UNDEFINED, this_val,
p->class_id);
if (JS_IsException(arr))
return JS_EXCEPTION;
ret = js_typed_array_sort(ctx, arr, argc, argv);
JS_FreeValue(ctx, arr);
return ret;
}

static const JSCFunctionListEntry js_typed_array_base_funcs[] = {
JS_CFUNC_DEF("from", 1, js_typed_array_from ),
JS_CFUNC_DEF("of", 0, js_typed_array_of ),
Expand Down Expand Up @@ -49598,6 +49616,7 @@ static const JSCFunctionListEntry js_typed_array_base_proto_funcs[] = {
JS_CFUNC_DEF("slice", 2, js_typed_array_slice ),
JS_CFUNC_DEF("subarray", 2, js_typed_array_subarray ),
JS_CFUNC_DEF("sort", 1, js_typed_array_sort ),
JS_CFUNC_DEF("toSorted", 1, js_typed_array_toSorted ),
JS_CFUNC_MAGIC_DEF("join", 1, js_typed_array_join, 0 ),
JS_CFUNC_MAGIC_DEF("toLocaleString", 0, js_typed_array_join, 1 ),
JS_CFUNC_MAGIC_DEF("indexOf", 1, js_typed_array_indexOf, special_indexOf ),
Expand Down
14 changes: 0 additions & 14 deletions test262_errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@ test262/test/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-
test262/test/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-no-throw.js:30: strict mode: TypeError: out-of-bound numeric index (Testing with Float64Array.)
test262/test/built-ins/TypedArray/prototype/sort/sort-tonumber.js:30: TypeError: ArrayBuffer is detached (Testing with Float64Array.)
test262/test/built-ins/TypedArray/prototype/sort/sort-tonumber.js:30: strict mode: TypeError: ArrayBuffer is detached (Testing with Float64Array.)
test262/test/built-ins/TypedArray/prototype/toSorted/ignores-species.js:26: TypeError: not a function (Testing with Float64Array.)
test262/test/built-ins/TypedArray/prototype/toSorted/ignores-species.js:26: strict mode: TypeError: not a function (Testing with Float64Array.)
test262/test/built-ins/TypedArray/prototype/toSorted/immutable.js:14: TypeError: not a function (Testing with Float64Array.)
test262/test/built-ins/TypedArray/prototype/toSorted/immutable.js:14: strict mode: TypeError: not a function (Testing with Float64Array.)
test262/test/built-ins/TypedArray/prototype/toSorted/length-property-ignored.js:21: TypeError: not a function (Testing with Float64Array.)
test262/test/built-ins/TypedArray/prototype/toSorted/length-property-ignored.js:21: strict mode: TypeError: not a function (Testing with Float64Array.)
test262/test/built-ins/TypedArray/prototype/toSorted/metadata/length.js:30: TypeError: cannot convert to object
test262/test/built-ins/TypedArray/prototype/toSorted/metadata/length.js:30: strict mode: TypeError: cannot convert to object
test262/test/built-ins/TypedArray/prototype/toSorted/metadata/name.js:28: TypeError: cannot convert to object
test262/test/built-ins/TypedArray/prototype/toSorted/metadata/name.js:28: strict mode: TypeError: cannot convert to object
test262/test/built-ins/TypedArray/prototype/toSorted/metadata/property-descriptor.js:18: Test262Error: typeof Expected SameValue(«undefined», «function») to be true
test262/test/built-ins/TypedArray/prototype/toSorted/metadata/property-descriptor.js:18: strict mode: Test262Error: typeof Expected SameValue(«undefined», «function») to be true
test262/test/built-ins/TypedArray/prototype/toSorted/not-a-constructor.js:25: Test262Error: isConstructor invoked with a non-function value
test262/test/built-ins/TypedArray/prototype/toSorted/not-a-constructor.js:25: strict mode: Test262Error: isConstructor invoked with a non-function value
test262/test/built-ins/TypedArray/prototype/with/BigInt/early-type-coercion-bigint.js:29: TypeError: not a function (Testing with BigInt64Array.)
test262/test/built-ins/TypedArray/prototype/with/BigInt/early-type-coercion-bigint.js:29: strict mode: TypeError: not a function (Testing with BigInt64Array.)
test262/test/built-ins/TypedArray/prototype/with/early-type-coercion.js:29: TypeError: not a function (Testing with Float64Array.)
Expand Down