fix version range when teh callback API changed
This commit is contained in:
parent
af75070bee
commit
ca345e9b99
|
@ -138,7 +138,7 @@ static JSBool heartbeat_callback(JSContext *cx)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if JS_VERSION >= 185
|
#if JS_VERSION >= 180
|
||||||
|
|
||||||
struct heartbeat {
|
struct heartbeat {
|
||||||
JSContext *cx;
|
JSContext *cx;
|
||||||
|
@ -259,7 +259,7 @@ static JSBool branch_callback(JSContext *cx, JSScript *script)
|
||||||
if (priv->branch_count == 0) {
|
if (priv->branch_count == 0) {
|
||||||
priv->branch_count = priv->branch_reset; /* reset branch count */
|
priv->branch_count = priv->branch_reset; /* reset branch count */
|
||||||
|
|
||||||
ret = heartbeat(cx);
|
ret = heartbeat_callback(cx);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -288,6 +288,8 @@ setup_heartbeat(JSContext *cx, int timeout, jscallback *cb, void *cbctx)
|
||||||
JS_SetContextPrivate(cx, priv);
|
JS_SetContextPrivate(cx, priv);
|
||||||
|
|
||||||
JS_SetBranchCallback(cx, branch_callback);
|
JS_SetBranchCallback(cx, branch_callback);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct heartbeat *enable_heartbeat(JSContext *cx)
|
static struct heartbeat *enable_heartbeat(JSContext *cx)
|
||||||
|
|
Loading…
Reference in New Issue