Skip to content

Commit b5cddd2

Browse files
John Haleymaxkorp
authored andcommitted
Fixed Oid/String parameter parsing on C++ end
1 parent 43762f9 commit b5cddd2

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

generate/combyne/partials/async_function.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) {
2020
{%partial convertFromV8 arg%}
2121
{%if not arg.isPayload %}
2222
baton->{{ arg.name }} = from_{{ arg.name }};
23-
{%if arg.cppClassName | isOid %}
23+
{%if arg | isOid %}
2424
baton->{{ arg.name }}NeedsFree = args[{{ arg.jsArg }}]->IsString();
2525
{%endif%}
2626
{%endif%}
@@ -132,7 +132,7 @@ void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleOKCallback() {
132132
{%else%}
133133
free((void *)baton->{{ arg.name }});
134134
{%endif%}
135-
{%elsif arg.cppClassName | isOid %}
135+
{%elsif arg | isOid %}
136136
if (baton->{{ arg.name}}NeedsFree) {
137137
free((void *)baton->{{ arg.name }});
138138
}

generate/combyne/partials/sync_function.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ from_{{ arg.name }}
4141
{%each args|argsInfo as arg %}
4242
{%if arg.shouldAlloc %}
4343
free({{ arg.name }});
44-
{%elsif arg.cppClassName | isOid %}
44+
{%elsif arg | isOid %}
4545
if (args[{{ arg.jsArg }}]->IsString()) {
4646
free({{ arg.name }});
4747
}
@@ -57,9 +57,9 @@ from_{{ arg.name }}
5757
{%endif%}
5858

5959
{%each args|argsInfo as arg %}
60-
{%if arg.cppClassName | isOid %}
60+
{%if arg | isOid %}
6161
if (args[{{ arg.jsArg }}]->IsString()) {
62-
free(from_{{ arg.name }});
62+
free(&from_{{ arg.name }});
6363
}
6464
{%endif%}
6565
{%endeach%}

generate/combyne/templates/class_header.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class {{ cppClassName }} : public ObjectWrap {
6969
{{ arg.cType|replace "**" "*" }} {{ arg.name }};
7070
{%else%}
7171
{{ arg.cType }} {{ arg.name }};
72-
{%if arg.cppClassName | isOid %}
72+
{%if arg | isOid %}
7373
bool {{ arg.name }}NeedsFree;
7474
{%endif%}
7575
{%endif%}

lib/repository.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,13 @@ Repository.prototype.getMasterCommit = function(callback) {
308308
* @param {Function} callback
309309
* @return {Commit}
310310
*/
311-
Repository.prototype.getHeadCommit = function(callback) {
312-
var repo = this;
311+
Repository.prototype.getHeadCommit = function(callback) {
312+
var repo = this;
313313

314-
return Reference.nameToId(repo, "HEAD").then(function(head) {
315-
return repo.getCommit(head, callback);
316-
});
317-
};
314+
return Reference.nameToId(repo, "HEAD").then(function(head) {
315+
return repo.getCommit(head, callback);
316+
});
317+
};
318318

319319
/**
320320
* Create a commit

0 commit comments

Comments
 (0)