From 3c4652c1c3a2231b2bb1e2bf43e6c16fc54d10bf Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 21 Mar 2020 20:01:38 +0000 Subject: Dukky: Upgrade dukky binding to support new heap/thread split Update the duktape bindings and dukky interface to support the new JS heap/thread split. Heaps may have multiple active threads though in general there will only be 2 at a time. Signed-off-by: Daniel Silverstone --- content/handlers/javascript/duktape/Window.bnd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'content/handlers/javascript/duktape/Window.bnd') diff --git a/content/handlers/javascript/duktape/Window.bnd b/content/handlers/javascript/duktape/Window.bnd index 44a5170d3..b4a467dfb 100644 --- a/content/handlers/javascript/duktape/Window.bnd +++ b/content/handlers/javascript/duktape/Window.bnd @@ -216,8 +216,8 @@ window_remove_callback_by_handle(duk_context *ctx, } RING_ITERATE_END(window->schedule_ring, sched); } -/* This is the dodgy compartment closedown method */ -static duk_ret_t dukky_window_closedown_compartment(duk_context *ctx) +/* This is the dodgy thread closedown method */ +static duk_ret_t dukky_window_closedown_thread(duk_context *ctx) { window_private_t *priv = NULL; @@ -230,7 +230,7 @@ static duk_ret_t dukky_window_closedown_compartment(duk_context *ctx) return 0; } - NSLOG(dukky, DEEPDEBUG, "Closing down compartment"); + NSLOG(dukky, DEEPDEBUG, "Closing down thread"); while (priv->schedule_ring != NULL) { window_remove_callback_by_handle(ctx, priv, @@ -361,10 +361,10 @@ prototype Window() /* ** WebAssembly */ /* As yet, Duktape lacks WA */ #undef EXPOSE - /* Add s3kr1t method to close the compartment */ + /* Add s3kr1t method to close the JS thread (browsing context) */ duk_dup(ctx, 0); - duk_push_string(ctx, MAGIC(closedownCompartment)); - duk_push_c_function(ctx, dukky_window_closedown_compartment, DUK_VARARGS); + duk_push_string(ctx, MAGIC(closedownThread)); + duk_push_c_function(ctx, dukky_window_closedown_thread, DUK_VARARGS); duk_def_prop(ctx, -3, DUK_DEFPROP_HAVE_VALUE | DUK_DEFPROP_HAVE_WRITABLE | -- cgit v1.2.3