Fixes for v8 3.17.10 (0x031710)

This commit is contained in:
Richard 2014-08-12 11:37:49 -05:00
commit 8829230641
3 changed files with 70 additions and 30 deletions

View file

@ -120,8 +120,12 @@ fail:
%fragment ("js_dtor", "templates")
%{
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
void $jswrapper(v8::Persistent< v8::Value > object, void *parameter)
{
SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter);
#elif (SWIG_V8_VERSION < 0x031900)
void $jswrapper(v8::Isolate *isolate, v8::Persistent< v8::Value > object, void *parameter)
{
SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter);
#else
@ -138,8 +142,10 @@ void $jswrapper(v8::Isolate *isolate, v8::Persistent< v8::Object > * object, SWI
delete proxy;
object.Clear();
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
object.Dispose();
#elif (SWIG_V8_VERSION < 0x031900)
object.Dispose(isolate);
#elif (SWIG_V8_VERSION < 0x032100)
object->Dispose(isolate);
#else
@ -156,8 +162,12 @@ void $jswrapper(v8::Isolate *isolate, v8::Persistent< v8::Object > * object, SWI
* ----------------------------------------------------------------------------- */
%fragment ("js_dtoroverride", "templates")
%{
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
void $jswrapper(v8::Persistent< v8::Value > object, void *parameter)
{
SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter);
#elif (SWIG_V8_VERSION < 0x031900)
void $jswrapper(v8::Isolate *isolate, v8::Persistent< v8::Value > object, void *parameter)
{
SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter);
#else
@ -170,8 +180,10 @@ void $jswrapper(v8::Isolate *isolate, v8::Persistent< v8::Object > * object, SWI
}
delete proxy;
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
object.Dispose();
#elif (SWIG_V8_VERSION < 0x031900)
object.Dispose(isolate);
#elif (SWIG_V8_VERSION < 0x032100)
object->Dispose(isolate);
#else
@ -331,8 +343,10 @@ fail:
%fragment("jsv8_define_class_template", "templates")
%{
v8::Handle<v8::FunctionTemplate> $jsmangledname_class = SWIGV8_CreateClassTemplate("$jsmangledname");
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
$jsmangledname_clientData.class_templ = v8::Persistent<v8::FunctionTemplate>::New($jsmangledname_class);
#elif (SWIG_V8_VERSION < 0x031900)
$jsmangledname_clientData.class_templ = v8::Persistent<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), $jsmangledname_class);
#else
$jsmangledname_clientData.class_templ.Reset(v8::Isolate::GetCurrent(), $jsmangledname_class);
#endif

View file

@ -81,8 +81,10 @@ void SWIGV8_INIT (v8::Handle<v8::Object> exports, v8::Handle<v8::Object> /*modul
%fragment("js_initializer", "templates")
%{
// a class template for creating proxies of undefined types
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
SWIGV8_SWIGTYPE_Proxy_class_templ = v8::Persistent<v8::FunctionTemplate>::New(SWIGV8_CreateClassTemplate("SwigProxy"));
#elif (SWIG_V8_VERSION < 0x031900)
SWIGV8_SWIGTYPE_Proxy_class_templ = v8::Persistent<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), SWIGV8_CreateClassTemplate("SwigProxy"));
#else
SWIGV8_SWIGTYPE_Proxy_class_templ.Reset(v8::Isolate::GetCurrent(), SWIGV8_CreateClassTemplate("SwigProxy"));
#endif

View file

@ -80,12 +80,15 @@ public:
};
~SWIGV8_Proxy() {
#if (SWIG_V8_VERSION < 0x031900 || SWIG_V8_VERSION >= 0x032100)
#if (SWIG_V8_VERSION < 0x031710)
handle.ClearWeak();
handle.Dispose();
#else
#elif (SWIG_V8_VERSION < 0x032100)
handle.ClearWeak(v8::Isolate::GetCurrent());
handle.Dispose(v8::Isolate::GetCurrent());
#else
handle.ClearWeak();
handle.Dispose();
#endif
handle.Clear();
@ -102,8 +105,10 @@ class SWIGV8_ClientData {
public:
v8::Persistent<v8::FunctionTemplate> class_templ;
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
void (*dtor) (v8::Persistent< v8::Value> object, void *parameter);
#elif (SWIG_V8_VERSION < 0x031900)
void (*dtor) (v8::Isolate *isolate, v8::Persistent< v8::Value> object, void *parameter);
#else
void (*dtor) (v8::Isolate *isolate, v8::Persistent< v8::Object > *object, SWIGV8_Proxy *proxy);
#endif
@ -143,8 +148,10 @@ int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void** ptr, swig_t
return SWIG_OK;
}
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
void SWIGV8_Proxy_DefaultDtor(v8::Persistent< v8::Value > object, void *parameter)
#elif (SWIG_V8_VERSION < 0x031900)
void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Value > object, void *parameter)
#else
void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Object > *object, SWIGV8_Proxy *proxy)
#endif
@ -188,37 +195,41 @@ void SWIGV8_SetPrivateData(v8::Handle<v8::Object> obj, void* ptr, swig_type_info
#if (SWIG_V8_VERSION < 0x031511)
obj->SetPointerInInternalField(0, cdata);
cdata->handle = v8::Persistent<v8::Object>::New(obj);
#elif (SWIG_V8_VERSION < 0x031900)
obj->SetAlignedPointerInInternalField(0, cdata);
cdata->handle = v8::Persistent<v8::Object>::New(obj);
#else
obj->SetAlignedPointerInInternalField(0, cdata);
#endif
#if (SWIG_V8_VERSION < 0x031710)
cdata->handle = v8::Persistent<v8::Object>::New(obj);
#elif (SWIG_V8_VERSION < 0x031900)
cdata->handle = v8::Persistent<v8::Object>::New(v8::Isolate::GetCurrent(), obj);
#else
cdata->handle.Reset(v8::Isolate::GetCurrent(), obj);
#endif
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
// clientdata must be set for owned data as we need to register the dtor
if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) {
cdata->handle.MakeWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor);
} else {
cdata->handle.MakeWeak(cdata, SWIGV8_Proxy_DefaultDtor);
}
cdata->handle.MarkIndependent();
#else
if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) {
cdata->handle.MakeWeak(v8::Isolate::GetCurrent(), cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor);
} else {
cdata->handle.MakeWeak(v8::Isolate::GetCurrent(), cdata, SWIGV8_Proxy_DefaultDtor);
}
#endif
#if (SWIG_V8_VERSION < 0x032100)
#if (SWIG_V8_VERSION < 0x031710)
cdata->handle.MarkIndependent();
#elif (SWIG_V8_VERSION < 0x032100)
cdata->handle.MarkIndependent(v8::Isolate::GetCurrent());
#else
cdata->handle.MarkIndependent();
#endif
#endif
}
int SWIG_V8_ConvertPtr(v8::Handle<v8::Value> valRef, void** ptr, swig_type_info *info, int flags) {
@ -398,8 +409,12 @@ int SWIGV8_ConvertPacked(v8::Handle<v8::Value> valRef, void *ptr, size_t sz, swi
return SWIG_OK;
}
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
void _wrap_SwigV8PackedData_delete(v8::Persistent< v8::Value > object, void *parameter)
{
SwigV8PackedData *cdata = static_cast<SwigV8PackedData *>(parameter);
#elif (SWIG_V8_VERSION < 0x031900)
void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent< v8::Value > object, void *parameter)
{
SwigV8PackedData *cdata = static_cast<SwigV8PackedData *>(parameter);
#else
@ -409,9 +424,12 @@ void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent< v8::Obj
delete cdata;
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
object.Clear();
object.Dispose();
#elif (SWIG_V8_VERSION < 0x031900)
object.Clear();
object.Dispose(isolate);
#elif (SWIG_V8_VERSION < 0x032100)
object->Dispose(isolate);
#else
@ -430,25 +448,31 @@ v8::Handle<v8::Value> SWIGV8_NewPackedObj(void *data, size_t size, swig_type_inf
#if (SWIG_V8_VERSION < 0x031511)
obj->SetPointerInInternalField(0, cdata);
cdata->handle = v8::Persistent<v8::Object>::New(obj);
#elif (SWIG_V8_VERSION < 0x031900)
obj->SetAlignedPointerInInternalField(0, cdata);
cdata->handle = v8::Persistent<v8::Object>::New(obj);
#else
obj->SetAlignedPointerInInternalField(0, cdata);
#endif
#if (SWIG_V8_VERSION < 0x031710)
cdata->handle = v8::Persistent<v8::Object>::New(obj);
#elif (SWIG_V8_VERSION < 0x031900)
cdata->handle = v8::Persistent<v8::Object>::New(v8::Isolate::GetCurrent(), obj);
#else
cdata->handle.Reset(v8::Isolate::GetCurrent(), obj);
#endif
#if (SWIG_V8_VERSION < 0x031900)
#if (SWIG_V8_VERSION < 0x031710)
cdata->handle.MakeWeak(cdata, _wrap_SwigV8PackedData_delete);
cdata->handle.MarkIndependent();
#else
cdata->handle.MakeWeak(v8::Isolate::GetCurrent(), cdata, _wrap_SwigV8PackedData_delete);
# if (SWIG_V8_VERSION < 0x032100)
cdata->handle.MarkIndependent(v8::Isolate::GetCurrent());
# else
#endif
#if (SWIG_V8_VERSION < 0x031710)
cdata->handle.MarkIndependent();
#elif (SWIG_V8_VERSION < 0x032100)
cdata->handle.MarkIndependent(v8::Isolate::GetCurrent());
#else
cdata->handle.MarkIndependent();
# endif
#endif
return scope.Close(obj);