Last active
June 18, 2020 13:08
-
-
Save SeaniaTwix/ca0fdc751da93c84fd121b5b8e300b27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun load(path: string) { | |
val ctx = Context.newBuilder("js").allowAllAccess(true).build() | |
val file = File(path) | |
val source = Source.newBuilder(JavaScriptLanguage.ID, file) | |
.mimeType("application/javascript+module").build() | |
val v = ctx.eval(source) | |
v.execute("outside: hello") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment