diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-05-07 20:43:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 20:43:27 +0200 |
commit | 2b66b8a03e4f81cc158be40d07534f26fa762c2b (patch) | |
tree | bdeb6b1e6737bd839c87e2d6d178da42d9004ca4 /cli/tests | |
parent | 93cf3bd5341d5985201ea0905280082d5a3310f9 (diff) |
BREAKING: Remove support for .wasm imports (#5135)
Importing .wasm files is non-standardized therefore deciding to
support current functionality past 1.0 release is risky.
Besides that .wasm import posed many challenges in our codebase
due to complex interactions with TS compiler which spawned
thread for each encountered .wasm import.
This commit removes:
- cli/compilers/wasm.rs
- cli/compilers/wasm_wrap.js
- two integration tests related to .wasm imports
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/051_wasm_import.ts | 22 | ||||
-rw-r--r-- | cli/tests/051_wasm_import.ts.out | 1 | ||||
-rw-r--r-- | cli/tests/051_wasm_import/remote.ts | 3 | ||||
-rw-r--r-- | cli/tests/051_wasm_import/simple.wasm | bin | 226 -> 0 bytes | |||
-rw-r--r-- | cli/tests/051_wasm_import/simple.wat | 31 | ||||
-rw-r--r-- | cli/tests/051_wasm_import/wasm-dep.js | 17 | ||||
-rw-r--r-- | cli/tests/055_import_wasm_via_network.ts | 2 | ||||
-rw-r--r-- | cli/tests/055_import_wasm_via_network.ts.out | 5 | ||||
-rw-r--r-- | cli/tests/055_import_wasm_via_network.wasm | bin | 97 -> 0 bytes | |||
-rw-r--r-- | cli/tests/integration_tests.rs | 12 |
10 files changed, 0 insertions, 93 deletions
diff --git a/cli/tests/051_wasm_import.ts b/cli/tests/051_wasm_import.ts deleted file mode 100644 index 7000657c3..000000000 --- a/cli/tests/051_wasm_import.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { add, addImported, addRemote } from "./051_wasm_import/simple.wasm"; -import { state } from "./051_wasm_import/wasm-dep.js"; - -function assertEquals(actual: unknown, expected: unknown, msg?: string): void { - if (actual !== expected) { - throw new Error(msg); - } -} - -assertEquals(state, "WASM Start Executed", "Incorrect state"); - -assertEquals(add(10, 20), 30, "Incorrect add"); - -assertEquals(addImported(0), 42, "Incorrect addImported"); - -assertEquals(state, "WASM JS Function Executed", "Incorrect state"); - -assertEquals(addImported(1), 43, "Incorrect addImported"); - -assertEquals(addRemote(1), 2020, "Incorrect addRemote"); - -console.log("Passed"); diff --git a/cli/tests/051_wasm_import.ts.out b/cli/tests/051_wasm_import.ts.out deleted file mode 100644 index 863339fb8..000000000 --- a/cli/tests/051_wasm_import.ts.out +++ /dev/null @@ -1 +0,0 @@ -Passed diff --git a/cli/tests/051_wasm_import/remote.ts b/cli/tests/051_wasm_import/remote.ts deleted file mode 100644 index 761a5248e..000000000 --- a/cli/tests/051_wasm_import/remote.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function jsRemoteFn(): number { - return 2019; -} diff --git a/cli/tests/051_wasm_import/simple.wasm b/cli/tests/051_wasm_import/simple.wasm Binary files differdeleted file mode 100644 index 8e544fe30..000000000 --- a/cli/tests/051_wasm_import/simple.wasm +++ /dev/null diff --git a/cli/tests/051_wasm_import/simple.wat b/cli/tests/051_wasm_import/simple.wat deleted file mode 100644 index 5e73db97b..000000000 --- a/cli/tests/051_wasm_import/simple.wat +++ /dev/null @@ -1,31 +0,0 @@ -;; From https://github.com/nodejs/node/blob/bbc254db5db672643aad89a436a4938412a5704e/test/fixtures/es-modules/simple.wat -;; MIT Licensed -;; $ wat2wasm simple.wat -o simple.wasm - -(module - (import "./wasm-dep.js" "jsFn" (func $jsFn (result i32))) - (import "./wasm-dep.js" "jsInitFn" (func $jsInitFn)) - (import "http://127.0.0.1:4545/cli/tests/051_wasm_import/remote.ts" "jsRemoteFn" (func $jsRemoteFn (result i32))) - (export "add" (func $add)) - (export "addImported" (func $addImported)) - (export "addRemote" (func $addRemote)) - (start $startFn) - (func $startFn - call $jsInitFn - ) - (func $add (param $a i32) (param $b i32) (result i32) - local.get $a - local.get $b - i32.add - ) - (func $addImported (param $a i32) (result i32) - local.get $a - call $jsFn - i32.add - ) - (func $addRemote (param $a i32) (result i32) - local.get $a - call $jsRemoteFn - i32.add - ) -) diff --git a/cli/tests/051_wasm_import/wasm-dep.js b/cli/tests/051_wasm_import/wasm-dep.js deleted file mode 100644 index 70b16348b..000000000 --- a/cli/tests/051_wasm_import/wasm-dep.js +++ /dev/null @@ -1,17 +0,0 @@ -function assertEquals(actual, expected, msg) { - if (actual !== expected) { - throw new Error(msg || ""); - } -} - -export function jsFn() { - state = "WASM JS Function Executed"; - return 42; -} - -export let state = "JS Function Executed"; - -export function jsInitFn() { - assertEquals(state, "JS Function Executed", "Incorrect state"); - state = "WASM Start Executed"; -} diff --git a/cli/tests/055_import_wasm_via_network.ts b/cli/tests/055_import_wasm_via_network.ts deleted file mode 100644 index 70d80365e..000000000 --- a/cli/tests/055_import_wasm_via_network.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as wasm from "./055_import_wasm_via_network.wasm"; -console.log(wasm); diff --git a/cli/tests/055_import_wasm_via_network.ts.out b/cli/tests/055_import_wasm_via_network.ts.out deleted file mode 100644 index c43c192fb..000000000 --- a/cli/tests/055_import_wasm_via_network.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -Module { - add_one: [Function: 0], - memory: WebAssembly.Memory {}, - Symbol(Symbol.toStringTag): "Module" -} diff --git a/cli/tests/055_import_wasm_via_network.wasm b/cli/tests/055_import_wasm_via_network.wasm Binary files differdeleted file mode 100644 index fb6d3e471..000000000 --- a/cli/tests/055_import_wasm_via_network.wasm +++ /dev/null diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index b549dc6d0..bbd437623 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1143,12 +1143,6 @@ itest_ignore!(_049_info_flag_script_jsx { http_server: true, }); -itest!(_051_wasm_import { - args: "run --reload --allow-net --allow-read 051_wasm_import.ts", - output: "051_wasm_import.ts.out", - http_server: true, -}); - // TODO(ry) Re-enable flaky test https://github.com/denoland/deno/issues/4049 itest_ignore!(_052_no_remote_flag { args: @@ -1165,12 +1159,6 @@ itest!(_054_info_local_imports { exit_code: 0, }); -itest!(_055_import_wasm_via_network { - args: "run --reload http://127.0.0.1:4545/cli/tests/055_import_wasm_via_network.ts", - output: "055_import_wasm_via_network.ts.out", - http_server: true, -}); - itest!(_056_make_temp_file_write_perm { args: "run --allow-read --allow-write=./subdir/ 056_make_temp_file_write_perm.ts", |