Skip to content

Commit

Permalink
Update quickjs
Browse files Browse the repository at this point in the history
Update from latest master. Bring in these two fixes:
 * bellard/quickjs#302
 * bellard/quickjs#313
  • Loading branch information
nickva committed Jul 18, 2024
1 parent 785f03b commit 1400d10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/couch_quickjs/patches/01-spidermonkey-185-mode.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- quickjs-master/quickjs.c 2024-05-30 10:41:37
+++ quickjs/quickjs.c 2024-07-05 16:23:27
--- quickjs-master/quickjs.c 2024-07-17 07:58:08
+++ quickjs/quickjs.c 2024-07-18 11:37:31
@@ -29451,10 +29451,24 @@
if (s->token.val == TOK_FUNCTION ||
(token_is_pseudo_keyword(s, JS_ATOM_async) &&
Expand Down
14 changes: 8 additions & 6 deletions src/couch_quickjs/quickjs/quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@ JSRuntime *JS_NewRuntime2(const JSMallocFunctions *mf, void *opaque)
rt->stack_size = JS_DEFAULT_STACK_SIZE;
JS_UpdateStackTop(rt);

rt->current_exception = JS_NULL;
rt->current_exception = JS_UNINITIALIZED;

return rt;
fail:
Expand Down Expand Up @@ -6398,13 +6398,13 @@ JSValue JS_GetException(JSContext *ctx)
JSValue val;
JSRuntime *rt = ctx->rt;
val = rt->current_exception;
rt->current_exception = JS_NULL;
rt->current_exception = JS_UNINITIALIZED;
return val;
}

JS_BOOL JS_HasException(JSContext *ctx)
{
return !JS_IsNull(ctx->rt->current_exception);
return !JS_IsUninitialized(ctx->rt->current_exception);
}

static void dbuf_put_leb128(DynBuf *s, uint32_t v)
Expand Down Expand Up @@ -15321,7 +15321,7 @@ static int JS_IteratorClose(JSContext *ctx, JSValueConst enum_obj,

if (is_exception_pending) {
ex_obj = ctx->rt->current_exception;
ctx->rt->current_exception = JS_NULL;
ctx->rt->current_exception = JS_UNINITIALIZED;
res = -1;
} else {
ex_obj = JS_UNDEFINED;
Expand Down Expand Up @@ -18674,7 +18674,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValueConst func_obj,
JS_IteratorClose(ctx, sp[-1], TRUE);
} else {
*sp++ = rt->current_exception;
rt->current_exception = JS_NULL;
rt->current_exception = JS_UNINITIALIZED;
pc = b->byte_code_buf + pos;
goto restart;
}
Expand Down Expand Up @@ -46165,8 +46165,10 @@ static JSValue js_proxy_get(JSContext *ctx, JSValueConst obj, JSAtom atom,
if (JS_IsException(ret))
return JS_EXCEPTION;
res = JS_GetOwnPropertyInternal(ctx, &desc, JS_VALUE_GET_OBJ(s->target), atom);
if (res < 0)
if (res < 0) {
JS_FreeValue(ctx, ret);
return JS_EXCEPTION;
}
if (res) {
if ((desc.flags & (JS_PROP_GETSET | JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)) == 0) {
if (!js_same_value(ctx, desc.value, ret)) {
Expand Down

0 comments on commit 1400d10

Please sign in to comment.