diff --git a/qjs.c b/qjs.c index d4061c0..5473f73 100644 --- a/qjs.c +++ b/qjs.c @@ -172,9 +172,12 @@ static int eval_file(JSContext *ctx, const char *filename, int module) "if (typeof std !== 'undefined') {\n" " globalThis.urlGet = std.urlGet;\n" " globalThis.loadFile = std.loadFile;\n" + " globalThis.doneRequire = std.loadFile;\n" " globalThis.printf = console.log;\n" " globalThis.evalFile = std.loadScript;\n" " globalThis.require = (moduleSpecifier) => import(moduleSpecifier).then(mod => mod.default || mod);\n" + " globalThis.stdRequire = globalThis.require;\n" + " globalThis.safeGlobals = {} \n" " globalThis.getURL = std.urlGet;\n" "} else {\n" " console.error('std is not defined.');\n" @@ -735,9 +738,12 @@ start: "if (typeof std !== 'undefined') {\n" " globalThis.urlGet = std.urlGet;\n" " globalThis.loadFile = std.loadFile;\n" + " globalThis.doneRequire = std.loadFile;\n" " globalThis.printf = console.log;\n" " globalThis.evalFile = std.loadScript;\n" " globalThis.require = (moduleSpecifier) => import(moduleSpecifier).then(mod => mod.default || mod);\n" + " globalThis.stdRequire = globalThis.require;\n" + " globalThis.safeGlobals = {} \n" " globalThis.getURL = std.urlGet;\n" "} else {\n" " console.error('std is not defined.');\n"