diff --git a/Lib/javascript/v8/javascriptcode.swg b/Lib/javascript/v8/javascriptcode.swg index 068632380..89d011e3d 100644 --- a/Lib/javascript/v8/javascriptcode.swg +++ b/Lib/javascript/v8/javascriptcode.swg @@ -18,8 +18,8 @@ typedef v8::AccessorInfo SwigV8PropertyCallbackInfo; typedef void SwigV8ReturnValue; typedef v8::FunctionCallbackInfo SwigV8Arguments; typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; -#define SWIGV8_RETURN(val) return args.GetReturnValue().Set(val) -#define SWIGV8_RETURN_INFO(val, info) return args.GetReturnValue().Set(val) +#define SWIGV8_RETURN(val) args.GetReturnValue().Set(val); return +#define SWIGV8_RETURN_INFO(val, info) info.GetReturnValue().Set(val); return #endif %} @@ -171,16 +171,25 @@ void $jswrapper(v8::Isolate *isolate, v8::Persistent< v8::Object > * object, SWI * ----------------------------------------------------------------------------- */ %fragment ("js_dtoroverride", "templates") %{ -void $jswrapper(v8::Persistent< v8::Value > object, void *parameter) { - SWIGV8_Proxy* proxy = (SWIGV8_Proxy*) parameter; +#if (SWIG_V8_VERSION < 0x031900) +void $jswrapper(v8::Persistent< v8::Value > object, void *parameter) +{ + SWIGV8_Proxy *proxy = static_cast(parameter); +#else +void $jswrapper(v8::Isolate *isolate, v8::Persistent< v8::Object > * object, SWIGV8_Proxy *proxy) +{ +#endif if(proxy->swigCMemOwn && proxy->swigCObject) { $jstype arg1 = ($jstype)proxy->swigCObject; ${destructor_action} } delete proxy; - object.Clear(); +#if (SWIG_V8_VERSION < 0x031900) object.Dispose(); +#else + object->Dispose(isolate); +#endif } %} @@ -214,7 +223,7 @@ fail: %fragment("js_setter", "templates") %{ void $jswrapper(v8::Local property, v8::Local value, - const SwigV8PropertyCallbackInfo& info) { + const SwigV8PropertyCallbackInfoVoid& info) { v8::HandleScope scope; $jslocals $jscode