Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix require.cache access in module
Browse files Browse the repository at this point in the history
  • Loading branch information
ialex32x committed Sep 27, 2021
1 parent 529c5c2 commit 58ec619
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Assets/jsb/Source/ScriptContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ public unsafe JSValue LoadModuleFromSource(byte[] source, string resolved_id, JS
expectedReturnValue = null;
JSApi.JS_SetProperty(ctx, require_obj, context.GetAtom("moduleId"), JSApi.JS_AtomToString(ctx, module_id_atom));
JSApi.JS_SetProperty(ctx, require_obj, context.GetAtom("main"), main_mod_obj);
JSApi.JS_SetProperty(ctx, require_obj, context.GetAtom("cache"), JSApi.JS_DupValue(ctx, _moduleCache));

var require_argv = new JSValue[5] { exports_obj, require_obj, module_obj, filename_obj, dirname_obj, };

Expand Down

0 comments on commit 58ec619

Please sign in to comment.