[Wasm] Stop supporting "_export.js" in test infra, use import/export capability in relevant tests

* It works slightly differently in SpiderMonkey.
* It was a hack.
This commit is contained in:
Zalim Bashorov
2023-03-06 17:25:26 +01:00
parent bec827b654
commit 4d7cf81ed0
4 changed files with 18 additions and 36 deletions
@@ -1,6 +1,5 @@
// Char issues
// IGNORE_BACKEND: JS_IR
// WASM_FAILS_IN: SM
// MODULE: main
// FILE: externals.js
@@ -241,16 +240,15 @@ fun box(): String {
return "OK"
}
// TODO: Rewrite test to use module system
fun hackNonModuleExport() {
js("globalThis.main = wasmExports;")
}
// FILE: entry.mjs
fun main() {
hackNonModuleExport()
}
import main from "./index.mjs"
// FILE: functionTypes__after.js
const boxResult = main.box();
if (boxResult != "OK") {
throw `Wrong box result '${boxResult}'; Expected "OK"`;
}
const exportedFres = main.exportedF()(1, 20, 300)("<", ">");
if (exportedFres !== "<321>")
+2 -11
View File
@@ -1,4 +1,3 @@
// WASM_FAILS_IN: SM
// MODULE: main
// FILE: externals.kt
@@ -26,17 +25,9 @@ fun anyAsEI(any: Any): EI = any as EI
fun box(): String = "OK"
// TODO: Rewrite test to use module system
// FILE: entry.mjs
fun hackNonModuleExport() {
js("globalThis.main = wasmExports;")
}
fun main() {
hackNonModuleExport()
}
// FILE: jsExport__after.js
import main from "./index.mjs"
const c = main.makeC(300);
if (main.getX(c) !== 300) {