summaryrefslogtreecommitdiff
path: root/quickjs.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2023-12-09 12:32:00 +0100
committerFabrice Bellard <fabrice@bellard.org>2023-12-09 12:32:00 +0100
commitb180cd2c439731d2fba39274f74c12ea9793dfd0 (patch)
tree7573a0106a49c8a0b7e8b1c6d31c4f49065ddb50 /quickjs.c
parente182050771b5971643be4e2391e2ba6f05eb1665 (diff)
downloadquickjs-b180cd2c439731d2fba39274f74c12ea9793dfd0.tar.gz
quickjs-b180cd2c439731d2fba39274f74c12ea9793dfd0.zip
Symbol.species is no longer used in TypedArray constructor from a TypedArray
Diffstat (limited to 'quickjs.c')
-rw-r--r--quickjs.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/quickjs.c b/quickjs.c
index 0d1cff3..e0ce634 100644
--- a/quickjs.c
+++ b/quickjs.c
@@ -52777,7 +52777,7 @@ static JSValue js_typed_array_constructor_ta(JSContext *ctx,
{
JSObject *p, *src_buffer;
JSTypedArray *ta;
- JSValue ctor, obj, buffer;
+ JSValue obj, buffer;
uint32_t len, i;
int size_log2;
JSArrayBuffer *src_abuf, *abuf;
@@ -52794,19 +52794,9 @@ static JSValue js_typed_array_constructor_ta(JSContext *ctx,
len = p->u.array.count;
src_buffer = ta->buffer;
src_abuf = src_buffer->u.array_buffer;
- if (!src_abuf->shared) {
- ctor = JS_SpeciesConstructor(ctx, JS_MKPTR(JS_TAG_OBJECT, src_buffer),
- JS_UNDEFINED);
- if (JS_IsException(ctor))
- goto fail;
- } else {
- /* force ArrayBuffer default constructor */
- ctor = JS_UNDEFINED;
- }
size_log2 = typed_array_size_log2(classid);
- buffer = js_array_buffer_constructor1(ctx, ctor,
+ buffer = js_array_buffer_constructor1(ctx, JS_UNDEFINED,
(uint64_t)len << size_log2);
- JS_FreeValue(ctx, ctor);
if (JS_IsException(buffer))
goto fail;
/* necessary because it could have been detached */