Fix AsVal macros of long and int for v8.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13813 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d13289cc91
commit
843c8a408c
1 changed files with 15 additions and 1 deletions
|
|
@ -29,11 +29,25 @@ v8::Handle<v8::Value> SWIG_From_dec(int)(int value)
|
|||
}
|
||||
}
|
||||
|
||||
%fragment(SWIG_AsVal_frag(int),"header") {
|
||||
SWIGINTERN
|
||||
int SWIG_AsVal_dec(int)(v8::Handle<v8::Value> valRef, int* val)
|
||||
{
|
||||
if (!valRef->IsInt32()) {
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
if(val) *val = valRef->IntegerValue();
|
||||
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
%fragment(SWIG_From_frag(long),"header") {
|
||||
SWIGINTERNINLINE
|
||||
v8::Handle<v8::Value> SWIG_From_dec(long)(long value)
|
||||
{
|
||||
return v8::Integer::New(value);
|
||||
return v8::Number::New(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue