Package ws.siri.jscore.runtime
Class Runtime
java.lang.Object
ws.siri.jscore.runtime.Runtime
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectConvert a JavaLike to a JSLikestatic Objectstatic @Nullable ObjectEvaluate a file, and returns the value of module.exportsstatic @Nullable Objectstatic Objectstatic org.mozilla.javascript.Contextstatic ModuleReturn the module at path, create a new one if does not existstatic voidinit()static voidstop()static ObjectUnwrap one layer of wrapperstatic Object
-
Field Details
-
global
-
-
Constructor Details
-
Runtime
public Runtime()
-
-
Method Details
-
init
public static void init() -
stop
public static void stop() -
evaluate
-
getPrelude
-
asJS
Convert a JavaLike to a JSLike- Parameters:
source-- Returns:
-
unwrap
Unwrap one layer of wrapper- Parameters:
source-- Returns:
-
wrap
-
autoWrap
-
getModule
Return the module at path, create a new one if does not exist- Parameters:
path-- Returns:
-
call
Evaluate a file, and returns the value of module.exports- Parameters:
path- path from which the expression comes frommode- mod to evaluate in: lazy or strictcontent- TODO provide a script instead of using the file content- Returns:
- module.exports
-
call
-
getContext
public static org.mozilla.javascript.Context getContext()
-