Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make Tree#createUpdated accept Array<TreeUpdate>
  • Loading branch information
rafaelgieschke committed Mar 22, 2017
commit bb4c0bd9720db7d30132a5fc0512b5e86080b429
10 changes: 10 additions & 0 deletions generate/input/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,16 @@
"tree": {
"selfFreeing": true,
"functions": {
"git_tree_create_updated": {
"args": {
"updates": {
"cType": "git_tree_update *",
"cppClassName": "Array",
"jsClassName": "Array",
"arrayElementCppClassName": "GitTreeUpdate"
}
}
},
"git_tree_entry_byid": {
"return": {
"ownedByThis": true
Expand Down
4 changes: 2 additions & 2 deletions generate/templates/partials/convert_from_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
{%elsif cppClassName == 'Array'%}

Array *tmp_{{ name }} = Array::Cast(*info[{{ jsArg }}]);
from_{{ name }} = ({{ cType }})malloc(tmp_{{ name }}->Length() * sizeof({{ cType|replace '**' '*' }}));
from_{{ name }} = ({{ cType }})malloc(tmp_{{ name }}->Length() * sizeof({{ cType|unPointer }}));
for (unsigned int i = 0; i < tmp_{{ name }}->Length(); i++) {
{%--
// FIXME: should recursively call convertFromv8.
--%}
from_{{ name }}[i] = Nan::ObjectWrap::Unwrap<{{ arrayElementCppClassName }}>(tmp_{{ name }}->Get(Nan::New(static_cast<double>(i)))->ToObject())->GetValue();
from_{{ name }}[i] = {%if not cType|isDoublePointer %}*{%endif%}Nan::ObjectWrap::Unwrap<{{ arrayElementCppClassName }}>(tmp_{{ name }}->Get(Nan::New(static_cast<double>(i)))->ToObject())->GetValue();
}
{%elsif cppClassName == 'Function'%}
{%elsif cppClassName == 'Buffer'%}
Expand Down