private void loadNativeModules(Scriptable env, Context cx, Scriptable globalScope,
Queue<Function> asyncCallbacksQueue) {
NativeModule[] nativeModules = {new FsNativeModule(asyncCallbacksQueue),
new ProcessNativeModule(env, asyncCallbacksQueue, exitCallbackExecutor),
new ChildProcessNativeModule(asyncCallbacksQueue),
new VmNativeModule(asyncCallbacksQueue)};
nativeModuleMap = new HashMap<String, Scriptable>();
for (NativeModule nativeModule : nativeModules) {
nativeModuleMap.put(nativeModule.getId(), nativeModule.getModule(cx, globalScope));