- java.lang.Object
-
- swim.dynamic.Bridge
-
- swim.vm.VmBridge
-
- swim.vm.js.JsBridge
-
- All Implemented Interfaces:
JsModuleLoader
,JsModuleResolver
public class JsBridge extends VmBridge implements JsModuleResolver, JsModuleLoader
-
-
Method Summary
-
Methods inherited from class swim.vm.VmBridge
getHostLibrary, getHostPackage, getHostType, guestCanExecute, guestCanInvokeMember, guestExecute, guestExecuteVoid, guestInvokeMember, guestLanguage, guestToHost, hostLibraries, hostPackages, hostRuntime, hostToGuest, hostType, hostTypes, isNativeHostClass, setGuestLanguage
-
-
-
-
Constructor Detail
-
JsBridge
public JsBridge(JsRuntime jsRuntime, org.graalvm.polyglot.Context jsContext)
-
-
Method Detail
-
jsRuntime
public final JsRuntime jsRuntime()
-
jsContext
public final org.graalvm.polyglot.Context jsContext()
-
moduleResolver
public JsModuleResolver moduleResolver()
-
getHostModule
public HostLibrary getHostModule(UriPath moduleId)
-
hostModules
public Map<UriPath,HostLibrary> hostModules()
-
hostTypedValueToGuestProxy
public <T> Object hostTypedValueToGuestProxy(HostType<? super T> hostType, T hostValue)
- Overrides:
hostTypedValueToGuestProxy
in classVmBridge
-
hostMethodToGuestMethod
public <T> Object hostMethodToGuestMethod(HostMethod<? super T> method, T self)
- Overrides:
hostMethodToGuestMethod
in classVmBridge
-
hostStaticMethodToGuestStaticMethod
public Object hostStaticMethodToGuestStaticMethod(HostStaticMethod staticMethod)
- Overrides:
hostStaticMethodToGuestStaticMethod
in classVmBridge
-
guestObjectPrototype
public Object guestObjectPrototype()
-
guestFunctionPrototype
public Object guestFunctionPrototype()
-
resolveModulePath
public UriPath resolveModulePath(UriPath basePath, UriPath modulePath)
- Specified by:
resolveModulePath
in interfaceJsModuleLoader
- Specified by:
resolveModulePath
in interfaceJsModuleResolver
-
loadModuleSource
public org.graalvm.polyglot.Source loadModuleSource(UriPath moduleId)
- Specified by:
loadModuleSource
in interfaceJsModuleResolver
-
loadModule
public JsModule loadModule(JsModuleSystem moduleSystem, UriPath moduleId)
- Specified by:
loadModule
in interfaceJsModuleLoader
-
loadHostModule
protected JsModule loadHostModule(JsModuleSystem moduleSystem, UriPath moduleId)
-
createHostModule
protected JsModule createHostModule(JsModuleSystem moduleSystem, UriPath moduleId, HostLibrary hostLibrary)
-
loadGuestModule
protected JsModule loadGuestModule(JsModuleSystem moduleSystem, UriPath moduleId)
-
createGuestModule
protected JsModule createGuestModule(JsModuleSystem moduleSystem, UriPath moduleId, org.graalvm.polyglot.Source moduleSource)
-
evalModule
public void evalModule(JsModule module)
- Specified by:
evalModule
in interfaceJsModuleLoader
-
eval
public JsModule eval(UriPath moduleId, CharSequence source)
-
eval
public JsModule eval(String moduleId, CharSequence source)
-
-