Skip to content

Commit 902b837

Browse files
author
John Haley
committed
Fixed returns for async functions when there is only 1 return
1 parent 22804cb commit 902b837

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

generate/templates/partials/async_function.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,13 @@ void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleOKCallback() {
9090
Handle<v8::Value> to;
9191
{%if .|returnsCount > 1 %}
9292
Handle<Object> result = NanNew<Object>();
93-
{%endif%}
94-
{%each .|returnsInfo 0 1 as _return %}
95-
{%partial convertToV8 _return %}
96-
{%if .|returnsCount > 1 %}
93+
{%each .|returnsInfo 0 1 as _return %}
94+
{%partial convertToV8 _return %}
95+
{%if .|returnsCount > 1 %}
9796
result->Set(NanNew<String>("{{ _return.returnNameOrName }}"), to);
98-
{%endif%}
99-
{%endeach%}
100-
{%if .|returnsCount == 1 %}
97+
{%endif%}
98+
{%endeach%}
99+
{%elsif .|returnsCount == 1 %}
101100
Handle<v8::Value> result = to;
102101
{%endif%}
103102
{%endif%}

0 commit comments

Comments
 (0)