Skip to content

Commit e8b9704

Browse files
Fabrice Bellardbnoordhuis
authored andcommitted
Symbol.species is no longer used in TypedArray constructor from a TypedArray
1 parent 46996ff commit e8b9704

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

quickjs.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49716,7 +49716,7 @@ static JSValue js_typed_array_constructor_ta(JSContext *ctx,
4971649716
{
4971749717
JSObject *p, *src_buffer;
4971849718
JSTypedArray *ta;
49719-
JSValue ctor, obj, buffer;
49719+
JSValue obj, buffer;
4972049720
uint32_t len, i;
4972149721
int size_log2;
4972249722
JSArrayBuffer *src_abuf, *abuf;
@@ -49733,19 +49733,9 @@ static JSValue js_typed_array_constructor_ta(JSContext *ctx,
4973349733
len = p->u.array.count;
4973449734
src_buffer = ta->buffer;
4973549735
src_abuf = src_buffer->u.array_buffer;
49736-
if (!src_abuf->shared) {
49737-
ctor = JS_SpeciesConstructor(ctx, JS_MKPTR(JS_TAG_OBJECT, src_buffer),
49738-
JS_UNDEFINED);
49739-
if (JS_IsException(ctor))
49740-
goto fail;
49741-
} else {
49742-
/* force ArrayBuffer default constructor */
49743-
ctor = JS_UNDEFINED;
49744-
}
4974549736
size_log2 = typed_array_size_log2(classid);
49746-
buffer = js_array_buffer_constructor1(ctx, ctor,
49737+
buffer = js_array_buffer_constructor1(ctx, JS_UNDEFINED,
4974749738
(uint64_t)len << size_log2);
49748-
JS_FreeValue(ctx, ctor);
4974949739
if (JS_IsException(buffer))
4975049740
goto fail;
4975149741
/* necessary because it could have been detached */

test262_errors.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ test262/test/built-ins/TypedArray/prototype/with/metadata/property-descriptor.js
6161
test262/test/built-ins/TypedArray/prototype/with/metadata/property-descriptor.js:18: strict mode: Test262Error: typeof Expected SameValue(«undefined», «function») to be true
6262
test262/test/built-ins/TypedArray/prototype/with/not-a-constructor.js:25: Test262Error: isConstructor invoked with a non-function value
6363
test262/test/built-ins/TypedArray/prototype/with/not-a-constructor.js:25: strict mode: Test262Error: isConstructor invoked with a non-function value
64-
test262/test/built-ins/TypedArrayConstructors/ctors/no-species.js:16: Test262Error: unreachable
65-
test262/test/built-ins/TypedArrayConstructors/ctors/no-species.js:16: strict mode: Test262Error: unreachable
6664
test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer.js:46: Test262Error: (Testing with BigInt64Array.)
6765
test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer.js:46: strict mode: Test262Error: (Testing with BigInt64Array.)
6866
test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/tonumber-value-detached-buffer.js:40: Test262Error: Reflect.defineProperty(ta, 0, {value: {valueOf() {$DETACHBUFFER(ta.buffer); return 42n;}}}) must return true Expected SameValue(«false», «true») to be true (Testing with BigInt64Array.)

0 commit comments

Comments
 (0)