JS_ExecuteScriptVersion 编辑
Obsolete since JSAPI 36
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
This article covers features introduced in SpiderMonkey 1.8.5
Execute a compiled script with specified version.
Syntax
JSBool
JS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSObject *scriptObj,
jsval *rval, JSVersion version);
Name | Type | Description |
---|---|---|
cx | JSContext * | The context in which to execute the script. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext . |
obj | JSObject * | The scope in which to execute the script. In the simplest cases, this should just be the embedding's global object.
In ECMAScript terms, the script is executed in a new execution context, but that context is not initialized quite as described in any of the three cases in ECMA 262-3 §10.2. Instead:
|
script | JSObject * | The compiled script to execute. |
rval | jsval * | Out parameter. On success, *rval receives the value from the last executed expression statement processed in the script. |
version | JSVersion | Version for the script. |
Description
JS_ExecuteScript
executes a previously-compiled script, script
.
If the script executes successfully, *rval
receives the value from the last executed expression statement processed in the script, and JS_ExecuteScript
returns true
. Otherwise it returns false
, and the value left in *rval
is unspecified.
To execute a script that has not been compiled, use JS::Evaluate
instead.
See Also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论