Fix SWIGV8_AppendOutput for OUTPUT typemaps
Create array to append to if the existing return type is not void. Closes #405 Closes #1121
This commit is contained in:
parent
59b780efed
commit
f7756be391
1 changed files with 8 additions and 0 deletions
|
|
@ -702,6 +702,14 @@ SWIGV8_VALUE SWIGV8_AppendOutput(SWIGV8_VALUE result, SWIGV8_VALUE obj) {
|
|||
|
||||
if (result->IsUndefined()) {
|
||||
result = SWIGV8_ARRAY_NEW();
|
||||
} else if (!result->IsArray()) {
|
||||
#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903)
|
||||
v8::Handle<v8::Array> tmparr = SWIGV8_ARRAY_NEW();
|
||||
#else
|
||||
v8::Local<v8::Array> tmparr = SWIGV8_ARRAY_NEW();
|
||||
#endif
|
||||
tmparr->Set(0, result);
|
||||
result = tmparr;
|
||||
}
|
||||
SWIGV8_ARRAY arr = SWIGV8_ARRAY::Cast(result);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue