From a18eb505c6fe1b7d3f58af7eb410bd4cfbd58657 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Fri, 16 Feb 2024 19:14:13 -0500 Subject: [PATCH] Update quickjs-wz --- 3rdparty/quickjs-wz | 2 +- lib/wzmaplib/src/map_script.cpp | 3 ++- src/quickjs_backend.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/3rdparty/quickjs-wz b/3rdparty/quickjs-wz index 163ce747d27..6b630270b1f 160000 --- a/3rdparty/quickjs-wz +++ b/3rdparty/quickjs-wz @@ -1 +1 @@ -Subproject commit 163ce747d271dfc3cfdc0dac92e342390c445ffd +Subproject commit 6b630270b1f430012ce0aa0a0079b9b618bbaa7d diff --git a/lib/wzmaplib/src/map_script.cpp b/lib/wzmaplib/src/map_script.cpp index 615e8e6aa5e..19f794012f1 100644 --- a/lib/wzmaplib/src/map_script.cpp +++ b/lib/wzmaplib/src/map_script.cpp @@ -713,7 +713,7 @@ std::shared_ptr runMapScript(const std::vector& fileBuffer, const std JS_FreeRuntime2(rt, QJSRuntimeFree_LeakHandler_Warning); pRuntimeFree_CustomLogger = nullptr; }); - JSLimitedContextOptions ctxOptions; + JSLimitedContextOptions ctxOptions = { }; ctxOptions.baseObjects = true; ctxOptions.dateObject = false; ctxOptions.eval = false; @@ -724,6 +724,7 @@ std::shared_ptr runMapScript(const std::vector& fileBuffer, const std ctxOptions.mapSet = true; ctxOptions.typedArrays = false; ctxOptions.promise = false; + ctxOptions.bigInt = false; JSContext *ctx = JS_NewLimitedContext(rt, &ctxOptions); if (ctx == nullptr) { diff --git a/src/quickjs_backend.cpp b/src/quickjs_backend.cpp index 2c22772f1ef..5633b037d64 100644 --- a/src/quickjs_backend.cpp +++ b/src/quickjs_backend.cpp @@ -152,7 +152,7 @@ class quickjs_scripting_instance : public wzapi::scripting_instance rt = JS_NewRuntime(); ASSERT(rt != nullptr, "JS_NewRuntime failed?"); - JSLimitedContextOptions ctxOptions; + JSLimitedContextOptions ctxOptions = { }; ctxOptions.baseObjects = true; ctxOptions.dateObject = true; ctxOptions.eval = (game.type == LEVEL_TYPE::CAMPAIGN); // allow "eval" only for campaign (which currently has lots of implicit eval usage) @@ -163,6 +163,7 @@ class quickjs_scripting_instance : public wzapi::scripting_instance ctxOptions.mapSet = true; ctxOptions.typedArrays = true; ctxOptions.promise = false; // disable promise, async, await + ctxOptions.bigInt = false; ctx = JS_NewLimitedContext(rt, &ctxOptions); ASSERT(ctx != nullptr, "JS_NewContext failed?");