From 710866995bb36b319e987110e891b1f6300f2a42 Mon Sep 17 00:00:00 2001 From: The Ghost of FOSS' Future <163201376+sneedgroup-holder@users.noreply.github.com> Date: Mon, 6 Jan 2025 19:28:30 -0600 Subject: [PATCH] add more polyfills --- qjs.c | 6 ++++++ 1 file changed, 6 insertions(+) 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"