File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ module.exports = function generateNativeCode() {
6060 isDoublePointer : require ( "../templates/filters/is_double_pointer" ) ,
6161 isFixedLengthString : require ( "../templates/filters/is_fixed_length_string" ) ,
6262 isOid : require ( "../templates/filters/is_oid" ) ,
63+ isPayload : require ( "../templates/filters/is_payload" ) ,
6364 isPointer : require ( "../templates/filters/is_pointer" ) ,
6465 isV8Value : require ( "../templates/filters/is_v8_value" ) ,
6566 jsArgsCount : require ( "../templates/filters/js_args_count" ) ,
Original file line number Diff line number Diff line change 1+ module . exports = function ( field ) {
2+ return field . name == 'payload' || field . payload ;
3+ } ;
Original file line number Diff line number Diff line change @@ -40,11 +40,15 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_asyncAfter(
4040
4141 {{ cppFunctionName }}_{{ cbFunction.name |titleCase }}Baton* baton = static_cast <{{ cppFunctionName }}_{{ cbFunction.name |titleCase }}Baton*>(req->data );
4242
43- NanCallback* callback = (NanCallback *)baton->payload ;
43+ {% each cbFunction.args |argsInfo as arg %}
44+ {% if arg | isPayload %}
45+ NanCallback* callback = (NanCallback *)baton->{{ arg.name }};
46+ {% endif %}
47+ {% endeach %}
4448
4549 Local<Value> argv[{{ cbFunction.args |jsArgsCount }}] = {
4650 {% each cbFunction.args |argsInfo as arg %}
47- {% if arg. name == " payload " %}
51+ {% if arg | isPayload %}
4852 {%-- payload is always the last arg --%}
4953 // payload is null because we can use closure scope in javascript
5054 NanUndefined ()
You can’t perform that action at this time.
0 commit comments