From 6b43c9083179ccb04deff1cf026cecf6a203bced Mon Sep 17 00:00:00 2001 From: Percs <83934299+Percslol@users.noreply.github.com> Date: Fri, 10 Jan 2025 19:28:44 -0600 Subject: [PATCH] fix: fix importfn and remove ts snip --- rewriter/wasm/build.sh | 1 - src/client/shared/import.ts | 10 +++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/rewriter/wasm/build.sh b/rewriter/wasm/build.sh index 02c3682..01dc2d2 100644 --- a/rewriter/wasm/build.sh +++ b/rewriter/wasm/build.sh @@ -40,7 +40,6 @@ cd ../../ wasm-snip rewriter/wasm/out/wasm_bg.wasm -o rewriter/wasm/out/wasm_snipped.wasm \ -p 'oxc_regular_expression::.*' \ 'oxc_parser::ts::types::::parse_non_array_type' \ - 'oxc_parser::ts::statement::::parse_declaration' \ 'oxc_parser::ts::types::::parse_ts_import_type' \ 'oxc_parser::ts::types::::parse_type_operator_or_higher' \ 'oxc_parser::ts::statement::::parse_ts_interface_declaration' \ diff --git a/src/client/shared/import.ts b/src/client/shared/import.ts index 83d93d6..7352a8c 100644 --- a/src/client/shared/import.ts +++ b/src/client/shared/import.ts @@ -5,14 +5,10 @@ import { rewriteUrl } from "../../shared/rewriters/url"; export default function (client: ScramjetClient, self: Self) { const Function = client.natives.store["Function"]; - self[config.globals.importfn] = function (base: string) { - return function (url: string) { - const resolved = new URL(url, base).href; + self[config.globals.importfn] = function (base: string, url: string) { + const resolved = new URL(url, base).href; - return Function( - `return import("${rewriteUrl(resolved, client.meta)}")` - )(); - }; + return Function(`return import("${rewriteUrl(resolved, client.meta)}")`)(); }; self[config.globals.metafn] = function (base: string) {