fix: fix importfn and remove ts snip

This commit is contained in:
Percs 2025-01-10 19:28:44 -06:00
parent f71e9c1ee0
commit 6b43c90831
2 changed files with 3 additions and 8 deletions

View file

@ -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::<impl oxc_parser::ParserImpl>::parse_non_array_type' \
'oxc_parser::ts::statement::<impl oxc_parser::ParserImpl>::parse_declaration' \
'oxc_parser::ts::types::<impl oxc_parser::ParserImpl>::parse_ts_import_type' \
'oxc_parser::ts::types::<impl oxc_parser::ParserImpl>::parse_type_operator_or_higher' \
'oxc_parser::ts::statement::<impl oxc_parser::ParserImpl>::parse_ts_interface_declaration' \

View file

@ -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) {