Fix function dispatching for v8.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13812 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Oliver Buchtala 2012-09-08 01:12:18 +00:00
commit d13289cc91
4 changed files with 160 additions and 60 deletions

View file

@ -64,6 +64,24 @@ JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef th
}
%}
%fragment ("JS_function_dispatcher", "templates")
%{
JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception)
{
$jslocals
JSValueRef jsresult;
int res;
$jscode
SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function $jsname.");
return jsresult;
goto fail;
fail:
return NULL;
}
%}
%fragment ("JS_functionwrapper_overload", "templates")
%{
int $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception, JSValueRef* result)
@ -96,11 +114,6 @@ int $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObjec
}
%}
%fragment ("JS_function_dispatch_case_default", "templates")
%{
SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function $jsname.");
%}
/* Added template for function declaration */
%fragment ("JS_variabledecl", "templates")