Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update quickjs-wz #3642

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty/quickjs-wz
Submodule quickjs-wz updated 65 files
+76 −0 .github/workflows/cmake-multi-platform.yml
+2 −2 CMakeLists.txt
+27 −0 Changelog
+1 −1 LICENSE
+2 −5 TODO
+1 −1 VERSION.txt
+2 −2 cutils.c
+11 −8 cutils.h
+297 −284 libbf.c
+11 −11 libbf.h
+2 −3 libregexp-opcode.h
+103 −184 libregexp.c
+3 −2 libregexp.h
+1,287 −1,250 libunicode-table.h
+333 −101 libunicode.c
+4 −1 libunicode.h
+3 −4 list.h
+1 −1 patches/001-add-extensions.patch
+1 −1 patches/002-add-disable-atomics-define.patch
+1 −1 patches/003-fix-pedantic-cxx-warnings.patch
+15 −15 patches/004-msvc-compatibility.patch
+0 −21 patches/005-bsd-compile-fixes.patch
+47 −55 patches/005-msvc-compatibility-64bit.patch
+34 −0 patches/006-msvc-compatibility-pt3.patch
+8 −8 patches/007-freeruntime2.patch
+16 −4 patches/008-bsd-compile-fixes.patch
+0 −26 patches/008-msvc-arm64-compat.patch
+1 −1 patches/009-asan-compatibility.patch
+12 −0 patches/010-win32-gmtime-nullcheck.patch
+19 −0 patches/011-fix-compile-without-bignum.patch
+0 −16 patches/011-fix-stack-overflow.patch
+8 −8 patches/apply_quickjs_patches.cmake
+16 −22 qjs.c
+29 −30 qjsc.c
+38 −38 qjscalc.js
+9 −9 quickjs-atom.h
+286 −181 quickjs-libc.c
+3 −2 quickjs-libc.h
+2 −3 quickjs-limitedcontext.c
+1 −0 quickjs-limitedcontext.h
+15 −8 quickjs-opcode.h
+3,975 −2,446 quickjs.c
+20 −8 quickjs.h
+4 −4 release.sh
+101 −76 repl.js
+93 −55 run-test262.c
+34 −16 test262.conf
+8 −35 test262_errors.txt
+3 −0 test262o.conf
+3 −3 tests/bjson.c
+121 −42 tests/microbench.js
+71 −0 tests/test262.patch
+10 −10 tests/test_bignum.js
+3 −3 tests/test_bjson.js
+41 −13 tests/test_builtin.js
+2 −2 tests/test_closure.js
+84 −15 tests/test_language.js
+25 −1 tests/test_loop.js
+2 −2 tests/test_op_overloading.js
+4 −4 tests/test_qjscalc.js
+38 −15 tests/test_std.js
+3 −2 tests/test_worker_module.js
+2 −2 unicode_download.sh
+250 −138 unicode_gen.c
+2 −0 unicode_gen_def.h
3 changes: 2 additions & 1 deletion lib/wzmaplib/src/map_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ std::shared_ptr<Map> runMapScript(const std::vector<char>& 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;
Expand All @@ -724,6 +724,7 @@ std::shared_ptr<Map> runMapScript(const std::vector<char>& fileBuffer, const std
ctxOptions.mapSet = true;
ctxOptions.typedArrays = false;
ctxOptions.promise = false;
ctxOptions.bigInt = false;
JSContext *ctx = JS_NewLimitedContext(rt, &ctxOptions);
if (ctx == nullptr)
{
Expand Down
3 changes: 2 additions & 1 deletion src/quickjs_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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?");

Expand Down
Loading