diff --git a/c/configmgr.c b/c/configmgr.c index f7adc2036..0526ab2a9 100644 --- a/c/configmgr.c +++ b/c/configmgr.c @@ -1847,9 +1847,15 @@ static void ensureLE64(){ int main(int argc, char **argv){ LoggingContext *logContext = makeLoggingContext(); logConfigureStandardDestinations(logContext); - if (argc >= 3 && !strcmp("-script",argv[1])){ + if (argc >= 3 && + (!strcmp("-script",argv[1]) || + !strcmp("-embeddedScript",argv[1]))){ char *filename = argv[2]; EJSNativeModule *modules[1]; + int loadMode = EJS_LOAD_IS_MODULE; + if (!strcmp("-embeddedScript",argv[1])){ + loadMode = EJS_LOAD_NOT_MODULE; + } EmbeddedJS *ejs = allocateEmbeddedJS(NULL); modules[0] = exportConfigManagerToEJS(ejs); configureEmbeddedJS(ejs,modules,1,argc,argv); @@ -1858,7 +1864,7 @@ int main(int argc, char **argv){ fflush(stdout); fflush(stderr); */ - int evalStatus = ejsEvalFile(ejs,filename,EJS_LOAD_IS_MODULE); + int evalStatus = ejsEvalFile(ejs,filename,loadMode); /* printf("Done with EJS: File eval returns %d_______________________________________________\n",evalStatus); */ } else { return simpleMain(argc,argv); diff --git a/c/embeddedjs.c b/c/embeddedjs.c index 5f02c9dac..cd6c5f8bd 100644 --- a/c/embeddedjs.c +++ b/c/embeddedjs.c @@ -2102,10 +2102,16 @@ bool configureEmbeddedJS(EmbeddedJS *embeddedJS, if (true){ /* load_std) {*/ const char *source = "import * as std from 'std';\n" "import * as os from 'os';\n" +#ifdef __ZOWE_OS_ZOS + "import * as zos from 'zos';\n" +#endif /* "import * as experiment from 'experiment';\n" */ /* "import * as FFI1 from 'FFI1';\n" */ "globalThis.std = std;\n" "globalThis.os = os;\n" +#ifdef __ZOWE_OS_ZOS + "globalThis.zos = zos;\n" +#endif /* "globalThis.experiment = experiment;\n"; */ ; size_t sourceLen = strlen(source);