Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions jvm/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ kt_jvm_library(
name = "supported_runtimes",
visibility = ["//visibility:public"],
exports = [
# MARK: Disable GraalJS testing
# "//jvm/graaljs",
"//jvm/graaljs",
"//jvm/hermes:hermes-host",
"//jvm/j2v8:j2v8-all",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public interface Runtime<Value> : Node {
override val format: RuntimeFormat<Value>

@ExperimentalPlayerApi
public fun executeRaw(script: String): Value =
throw UnsupportedOperationException("This experimental method is not implemented for ${this::class.simpleName}")
public fun executeRaw(script: String): Value

/** Execute some arbitrary [script] and return the deserialized result */
public fun execute(script: String): Any?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.intuit.playerui.core.bridge.runtime.PlayerRuntimeFactory
import com.intuit.playerui.core.bridge.runtime.Runtime
import com.intuit.playerui.core.bridge.runtime.ScriptContext
import com.intuit.playerui.core.bridge.serialization.serializers.playerSerializersModule
import com.intuit.playerui.core.experimental.ExperimentalPlayerApi
import com.intuit.playerui.core.player.PlayerException
import com.intuit.playerui.core.utils.InternalPlayerApi
import com.intuit.playerui.graaljs.bridge.GraalNode
Expand Down Expand Up @@ -71,6 +72,11 @@ internal class GraalRuntime(
CoroutineScope(Dispatchers.Default + SupervisorJob() + (config.coroutineExceptionHandler ?: EmptyCoroutineContext))
}

@ExperimentalPlayerApi
override fun executeRaw(script: String): Value = context.blockingLock {
context.eval("js", script)
}

override fun execute(script: String): Any? = context.blockingLock {
context.eval("js", script).handleValue(format)
}
Expand Down