Skip to content

Commit

Permalink
Update to reflect new JSLimitedContextOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Feb 8, 2025
1 parent 3621d7e commit 41de61e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/wzmaplib/src/map_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,14 +737,14 @@ std::shared_ptr<Map> runMapScript(const std::vector<char>& fileBuffer, const std
ctxOptions.baseObjects = true;
ctxOptions.dateObject = false;
ctxOptions.eval = false;
ctxOptions.stringNormalize = false;
ctxOptions.regExp = false;
ctxOptions.json = false;
ctxOptions.proxy = false;
ctxOptions.mapSet = true;
ctxOptions.typedArrays = false;
ctxOptions.promise = false;
ctxOptions.bigInt = false;
ctxOptions.weakRef = false;
JSContext *ctx = JS_NewLimitedContext(rt, &ctxOptions);
if (ctx == nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion src/quickjs_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ class quickjs_scripting_instance : public wzapi::scripting_instance
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)
ctxOptions.stringNormalize = true;
ctxOptions.regExp = true;
ctxOptions.json = true;
ctxOptions.proxy = true;
ctxOptions.mapSet = true;
ctxOptions.typedArrays = true;
ctxOptions.promise = false; // disable promise, async, await
ctxOptions.bigInt = false;
ctxOptions.weakRef = false;
ctx = JS_NewLimitedContext(rt, &ctxOptions);
ASSERT(ctx != nullptr, "JS_NewContext failed?");

Expand Down

0 comments on commit 41de61e

Please sign in to comment.