diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2023-12-09 12:31:33 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-12-09 22:26:51 +0100 |
commit | 9bf0ebdc3062c9f3c35cb89fdd6ca5546e1ba683 (patch) | |
tree | c777188ddca725f3f7ca5c80f9fa8a5706048f9b /lib/quickjs/quickjs.c | |
parent | 1b38f7b7a7709c3fe21f1adcf1d5de6b2e0e48f7 (diff) | |
download | chawan-9bf0ebdc3062c9f3c35cb89fdd6ca5546e1ba683.tar.gz |
fixed delete super.x error
Diffstat (limited to 'lib/quickjs/quickjs.c')
-rw-r--r-- | lib/quickjs/quickjs.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c index f10e35aa..03f0af0b 100644 --- a/lib/quickjs/quickjs.c +++ b/lib/quickjs/quickjs.c @@ -24781,6 +24781,8 @@ static __exception int js_parse_delete(JSParseState *s) case OP_scope_get_private_field: return js_parse_error(s, "cannot delete a private class field"); case OP_get_super_value: + fd->byte_code.size = fd->last_opcode_pos; + fd->last_opcode_pos = -1; emit_op(s, OP_throw_error); emit_atom(s, JS_ATOM_NULL); emit_u8(s, JS_THROW_ERROR_DELETE_SUPER); @@ -53021,7 +53023,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; @@ -53038,19 +53040,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 */ |