Skip to content

Commit 6b43c90

Browse files
committed
fix: fix importfn and remove ts snip
1 parent f71e9c1 commit 6b43c90

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

rewriter/wasm/build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ cd ../../
4040
wasm-snip rewriter/wasm/out/wasm_bg.wasm -o rewriter/wasm/out/wasm_snipped.wasm \
4141
-p 'oxc_regular_expression::.*' \
4242
'oxc_parser::ts::types::<impl oxc_parser::ParserImpl>::parse_non_array_type' \
43-
'oxc_parser::ts::statement::<impl oxc_parser::ParserImpl>::parse_declaration' \
4443
'oxc_parser::ts::types::<impl oxc_parser::ParserImpl>::parse_ts_import_type' \
4544
'oxc_parser::ts::types::<impl oxc_parser::ParserImpl>::parse_type_operator_or_higher' \
4645
'oxc_parser::ts::statement::<impl oxc_parser::ParserImpl>::parse_ts_interface_declaration' \

src/client/shared/import.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ import { rewriteUrl } from "../../shared/rewriters/url";
55
export default function (client: ScramjetClient, self: Self) {
66
const Function = client.natives.store["Function"];
77

8-
self[config.globals.importfn] = function (base: string) {
9-
return function (url: string) {
10-
const resolved = new URL(url, base).href;
8+
self[config.globals.importfn] = function (base: string, url: string) {
9+
const resolved = new URL(url, base).href;
1110

12-
return Function(
13-
`return import("${rewriteUrl(resolved, client.meta)}")`
14-
)();
15-
};
11+
return Function(`return import("${rewriteUrl(resolved, client.meta)}")`)();
1612
};
1713

1814
self[config.globals.metafn] = function (base: string) {

0 commit comments

Comments
 (0)