Skip to content

Commit 9d9be0e

Browse files
authored
feat(graalvm): support webassembly api in js (#1273)
feat(graalvm): support webassembly api in js test(graalvm): enable webassembly api tests Closes #1272 Relates-to: #1272 Signed-off-by: Sam Gammon <[email protected]>
1 parent 5f76bba commit 9d9be0e

File tree

6 files changed

+5
-13
lines changed

6 files changed

+5
-13
lines changed

packages/entry/src/main/kotlin/elide/entry/main.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import java.util.concurrent.ThreadFactory
1717

1818
private val languages = arrayOf(
1919
"js",
20+
"wasm",
2021
)
2122

2223
private val contextBuilder = Context.newBuilder(*languages)

packages/graalvm/src/main/kotlin/elide/runtime/core/internals/graalvm/GraalVMEngine.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ import org.graalvm.polyglot.HostAccess as PolyglotHostAccess
273273
TypeScriptLanguage.ID -> listOf(
274274
JavaScriptLanguage.ID,
275275
TypeScriptLanguage.ID,
276+
"wasm", // @TODO better reference
276277
)
277278

278279
else -> listOf(it.languageId)

packages/graalvm/src/main/kotlin/elide/runtime/plugins/js/JavaScript.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import elide.runtime.plugins.js.JavaScriptVersion.*
6969
"js.strict",
7070
"js.temporal",
7171
"js.top-level-await",
72+
"js.webassembly",
7273
// Experimental:
7374
"js.async-context",
7475
"js.async-iterator-helpers",

packages/graalvm/src/main/kotlin/elide/runtime/plugins/js/JavaScriptConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ import elide.runtime.plugins.js.JavaScriptVersion.ES2022
146146
public var v8: Boolean = true
147147

148148
/** Enable WASM support and related bindings. Defaults to `true`; only active where supported. */
149-
public var wasm: Boolean = false
149+
public var wasm: Boolean = true
150150

151151
/** Enable experimental built-in runtime support for TypeScript. Defaults to `false`. */
152152
public var typescript: Boolean = true

packages/graalvm/src/test/kotlin/elide/runtime/intrinsics/js/JsGlobalsTest.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ private const val ENABLE_SUPPRESSIONS = true
121121
"Reflect",
122122
"Proxy",
123123
"Intl",
124+
"WebAssembly",
124125
)
125126

126127
// Expected Node-specific global symbols.
@@ -181,7 +182,6 @@ private const val ENABLE_SUPPRESSIONS = true
181182
"TransformStreamDefaultController",
182183
"URL",
183184
"URLSearchParams",
184-
"WebAssembly",
185185
"WebSocket",
186186
"WritableStream",
187187
"WritableStreamDefaultController",
@@ -227,7 +227,6 @@ private const val ENABLE_SUPPRESSIONS = true
227227
"EventSource", // not yet implemented
228228
"FormData", // not yet implemented
229229
"Navigator", // not yet implemented
230-
"WebAssembly", // not yet implemented
231230
"WebSocket", // not yet implemented
232231
"PerformanceEntry", // not yet implemented
233232
"PerformanceMark", // not yet implemented

packages/graalvm/src/test/kotlin/elide/runtime/winter/CommonMinimumTest.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ private const val ENABLE_SUPPRESSIONS = true
6666
"TextDecoderStream",
6767
"TextEncoderStream",
6868
"URLPattern",
69-
"WebAssembly.Global",
70-
"WebAssembly.Instance",
71-
"WebAssembly.Memory",
72-
"WebAssembly.Module",
73-
"WebAssembly.Table",
74-
"WebAssembly.compile",
75-
"WebAssembly.compileStreaming",
76-
"WebAssembly.instantiate",
77-
"WebAssembly.instantiateStreaming",
78-
"WebAssembly.validate",
7969
"navigator.userAgent",
8070
"structuredClone",
8171
)

0 commit comments

Comments
 (0)