提供对 Rhino JavaScript 引擎的访问。
将一个类定义为 Rhino 主机对象。
JavaClass | javaClass | the class to define as host object |
当当前的 RingoJS 实例终止时,注册一个要调用的回调函数。
Function|Object | funcOrObject | Either a JavaScript function or a
JavaScript object containing properties called |
Boolean | sync | (optional) whether to invoke the callback synchronously (on the main shutdown thread) or asynchronously (on the worker's event loop thread) |
获取将它作为 Java 对象公开为 JavaScript 的对象的包装器。
Object | object | an object |
Object | the object wrapped as native java object |
获取将 java.lang.String 方法公开给 JavaScript 的字符串的包装器这对于以无 java.lang.String 的形式访问字符串非常有用,无需创建新实例。
Object | object | an object |
Object | the object converted to a string and wrapped as native java object |
使用与此相同的安装目录创建一个Sandbox脚本引擎,以及给定的模块路径,全局属性,类shutter和密封
Array | modulePath | the comma separated module search path |
Object | globals | a map of predefined global properties (may be undefined) |
Object | options | an options object (may be undefined). The following options are supported:
|
RhinoEngine | a sandboxed RhinoEngine instance |
获取与当前线程或给定范围或函数对象关联的worker实例。
Object | obj | optional scope or function to get the worker from. |
org.ringojs.engine.RingoWorker | the current worker |
获取包含当前worker中遇到的语法错误的列表
ScriptableList | a list containing the errors encountered in the current worker |
获取当前线程和上下文的 Rhino 优化级别。优化级别是-1(解释器模式)和 9(编译模式,所有优化启用)之间的整数。默认级别是 0。
Number | level an integer between -1 and 9 |
获取应用程序的模块搜索路径作为存储库列表。
ScriptableList | a list containing the module search path repositories |
获取与当前线程关联的 org.mozilla.javascript.Context。
获取与此应用程序关联的 org.ringojs.engine.RhinoEngine。
org.ringojs.engine.RhinoEngine | the current RhinoEngine instance |
获取 RingoJS 安装目录。
Repository | a Repository representing the Ringo installation directory |
为当前线程和上下文设置 Rhino 优化级别。优化级别是 -1(解释器模式)和 9(编译模式,所有优化启用)之间的整数。默认级别是 0。
Number | level | an integer between -1 and 9 |
RingoJS 版本是一个类似数组的对象,主要和次要版本号作为第一个和第二个元素。