mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
Bug 1029: Use JS_CallFunctionValue in elinks_object.c
JS_CallFunction does not support closures in SpiderMonkey versions earlier than 1.8. Test case: function set_suffix(suffix) { elinks.preformat_html = function(cached, vs) { cached.content += suffix; } } set_suffix("hello");
This commit is contained in:
parent
079b97d21b
commit
e3830cfd67
@ -176,8 +176,6 @@ JSBool
|
||||
smjs_invoke_elinks_object_method(unsigned char *method, jsval argv[], int argc,
|
||||
jsval *rval)
|
||||
{
|
||||
JSFunction *func;
|
||||
|
||||
assert(smjs_ctx);
|
||||
assert(smjs_elinks_object);
|
||||
assert(rval);
|
||||
@ -190,9 +188,6 @@ smjs_invoke_elinks_object_method(unsigned char *method, jsval argv[], int argc,
|
||||
if (JSVAL_VOID == *rval)
|
||||
return JS_FALSE;
|
||||
|
||||
func = JS_ValueToFunction(smjs_ctx, *rval);
|
||||
if (!func) return JS_FALSE;
|
||||
|
||||
return JS_CallFunction(smjs_ctx, smjs_elinks_object,
|
||||
func, argc, argv, rval);
|
||||
return JS_CallFunctionValue(smjs_ctx, smjs_elinks_object,
|
||||
*rval, argc, argv, rval);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user