diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2023-12-07 17:51:32 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-12-08 10:49:16 +0100 |
commit | 09bb1c03b5c93294dc4a3355a831a17a3274e31b (patch) | |
tree | 4b40b1610925a461be4e3c54e155dc032f0b34c5 /lib | |
parent | 8dd0d8c475fe28c2a6b99e472bcf7ebc52dcadb3 (diff) | |
download | chawan-09bb1c03b5c93294dc4a3355a831a17a3274e31b.tar.gz |
fixed private field setters (github issue #194)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/quickjs/quickjs-opcode.h | 2 | ||||
-rw-r--r-- | lib/quickjs/quickjs.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/quickjs/quickjs-opcode.h b/lib/quickjs/quickjs-opcode.h index c731a14a..15a9fce6 100644 --- a/lib/quickjs/quickjs-opcode.h +++ b/lib/quickjs/quickjs-opcode.h @@ -279,7 +279,7 @@ def( scope_get_ref, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase def(scope_put_var_init, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */ def(scope_get_private_field, 7, 1, 1, atom_u16) /* obj -> value, emitted in phase 1, removed in phase 2 */ def(scope_get_private_field2, 7, 1, 2, atom_u16) /* obj -> obj value, emitted in phase 1, removed in phase 2 */ -def(scope_put_private_field, 7, 1, 1, atom_u16) /* obj value ->, emitted in phase 1, removed in phase 2 */ +def(scope_put_private_field, 7, 2, 0, atom_u16) /* obj value ->, emitted in phase 1, removed in phase 2 */ def( set_class_name, 5, 1, 1, u32) /* emitted in phase 1, removed in phase 2 */ diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c index 494c4a69..e6a5d2e9 100644 --- a/lib/quickjs/quickjs.c +++ b/lib/quickjs/quickjs.c @@ -30078,6 +30078,7 @@ static int resolve_scope_private_field(JSContext *ctx, JSFunctionDef *s, /* obj func value */ dbuf_putc(bc, OP_call_method); dbuf_put_u16(bc, 1); + dbuf_putc(bc, OP_drop); } break; default: @@ -32156,7 +32157,7 @@ static __exception int ss_check(JSContext *ctx, StackSizeState *s, if (s->stack_level_tab[pos] != 0xffff) { /* already explored: check that the stack size is consistent */ if (s->stack_level_tab[pos] != stack_len) { - JS_ThrowInternalError(ctx, "unconsistent stack size: %d %d (pc=%d)", + JS_ThrowInternalError(ctx, "inconsistent stack size: %d %d (pc=%d)", s->stack_level_tab[pos], stack_len, pos); return -1; } else { |