Javascript code formatting corrections
This commit is contained in:
parent
c4d003e442
commit
b6aa39b82a
2 changed files with 15 additions and 21 deletions
|
|
@ -39,23 +39,23 @@ SWIG_AsVal_dec(Type) (SWIGV8_VALUE o, Type* val)
|
|||
if (o->IsArray()) {
|
||||
SWIGV8_ARRAY array = SWIGV8_ARRAY::Cast(o);
|
||||
|
||||
if(array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2].");
|
||||
if (array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2].");
|
||||
double re, im;
|
||||
int res;
|
||||
|
||||
res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 0), &re);
|
||||
if(!SWIG_IsOK(res)) {
|
||||
if (!SWIG_IsOK(res)) {
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
|
||||
res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 1), &im);
|
||||
if(!SWIG_IsOK(res)) {
|
||||
if (!SWIG_IsOK(res)) {
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
|
||||
if (val) *val = Constructor(re, im);
|
||||
return SWIG_OK;
|
||||
} else if(o->IsNumber()){
|
||||
} else if (o->IsNumber()) {
|
||||
double d;
|
||||
int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d));
|
||||
if (SWIG_IsOK(res)) {
|
||||
|
|
@ -81,17 +81,17 @@ SWIG_AsVal_dec(Type) (SWIGV8_VALUE o, Type* val)
|
|||
if (o->IsArray()) {
|
||||
SWIGV8_ARRAY array = SWIGV8_ARRAY::Cast(o);
|
||||
|
||||
if(array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2].");
|
||||
if (array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2].");
|
||||
double re, im;
|
||||
int res;
|
||||
|
||||
res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 0), &re);
|
||||
if(!SWIG_IsOK(res)) {
|
||||
if (!SWIG_IsOK(res)) {
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
|
||||
res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 1), &im);
|
||||
if(!SWIG_IsOK(res)) {
|
||||
if (!SWIG_IsOK(res)) {
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ SWIG_AsVal_dec(Type) (SWIGV8_VALUE o, Type* val)
|
|||
} else {
|
||||
return SWIG_OverflowError;
|
||||
}
|
||||
} else if(o->IsNumber()){
|
||||
} else if (o->IsNumber()) {
|
||||
float re;
|
||||
int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re));
|
||||
if (SWIG_IsOK(res)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue