mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-27 08:50:02 +03:00
ensure JS_EvaluateScript has a variable to return its result
This commit is contained in:
parent
06b08d3af0
commit
bb42a650df
@ -123,6 +123,7 @@ jsobject *js_newcompartment(jscontext *ctx, void *win_priv, void *doc_priv)
|
|||||||
bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
|
bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
|
||||||
{
|
{
|
||||||
JSContext *cx = (JSContext *)ctx;
|
JSContext *cx = (JSContext *)ctx;
|
||||||
|
jsval rval;
|
||||||
|
|
||||||
/* JSLOG("%p \"%s\"",cx ,txt); */
|
/* JSLOG("%p \"%s\"",cx ,txt); */
|
||||||
|
|
||||||
@ -141,7 +142,7 @@ bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
|
|||||||
if (JS_EvaluateScript(cx,
|
if (JS_EvaluateScript(cx,
|
||||||
JS_GetGlobalObject(cx),
|
JS_GetGlobalObject(cx),
|
||||||
txt, txtlen,
|
txt, txtlen,
|
||||||
"<head>", 0, NULL) == JS_TRUE) {
|
"<head>", 0, &rval) == JS_TRUE) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user