mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
fix: fix importfn and remove ts snip
This commit is contained in:
parent
f71e9c1ee0
commit
6b43c90831
2 changed files with 3 additions and 8 deletions
|
@ -40,7 +40,6 @@ cd ../../
|
||||||
wasm-snip rewriter/wasm/out/wasm_bg.wasm -o rewriter/wasm/out/wasm_snipped.wasm \
|
wasm-snip rewriter/wasm/out/wasm_bg.wasm -o rewriter/wasm/out/wasm_snipped.wasm \
|
||||||
-p 'oxc_regular_expression::.*' \
|
-p 'oxc_regular_expression::.*' \
|
||||||
'oxc_parser::ts::types::<impl oxc_parser::ParserImpl>::parse_non_array_type' \
|
'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_ts_import_type' \
|
||||||
'oxc_parser::ts::types::<impl oxc_parser::ParserImpl>::parse_type_operator_or_higher' \
|
'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' \
|
'oxc_parser::ts::statement::<impl oxc_parser::ParserImpl>::parse_ts_interface_declaration' \
|
||||||
|
|
|
@ -5,14 +5,10 @@ import { rewriteUrl } from "../../shared/rewriters/url";
|
||||||
export default function (client: ScramjetClient, self: Self) {
|
export default function (client: ScramjetClient, self: Self) {
|
||||||
const Function = client.natives.store["Function"];
|
const Function = client.natives.store["Function"];
|
||||||
|
|
||||||
self[config.globals.importfn] = function (base: string) {
|
self[config.globals.importfn] = function (base: string, url: string) {
|
||||||
return function (url: string) {
|
|
||||||
const resolved = new URL(url, base).href;
|
const resolved = new URL(url, base).href;
|
||||||
|
|
||||||
return Function(
|
return Function(`return import("${rewriteUrl(resolved, client.meta)}")`)();
|
||||||
`return import("${rewriteUrl(resolved, client.meta)}")`
|
|
||||||
)();
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self[config.globals.metafn] = function (base: string) {
|
self[config.globals.metafn] = function (base: string) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue