| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2fa3150 commit 22804cb
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,6 +60,7 @@ module.exports = function generateNativeCode() { | |||
| 60 | 60 | isDoublePointer: require("../templates/filters/is_double_pointer"), | |
| 61 | 61 | isFixedLengthString: require("../templates/filters/is_fixed_length_string"), | |
| 62 | 62 | isOid: require("../templates/filters/is_oid"), | |
| 63 | + isPayload: require("../templates/filters/is_payload"), | ||
| 63 | 64 | isPointer: require("../templates/filters/is_pointer"), | |
| 64 | 65 | isV8Value: require("../templates/filters/is_v8_value"), | |
| 65 | 66 | jsArgsCount: require("../templates/filters/js_args_count"), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 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( | |||
| 40 | 40 | ||
| 41 | 41 | {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(req->data); | |
| 42 | 42 | ||
| 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 %} | ||
| 44 | 48 | ||
| 45 | 49 | Local<Value> argv[{{ cbFunction.args|jsArgsCount }}] = { | |
| 46 | 50 | {% each cbFunction.args|argsInfo as arg %} | |
| 47 | - {% if arg.name == "payload" %} | ||
| 51 | + {% if arg | isPayload %} | ||
| 48 | 52 | {%-- payload is always the last arg --%} | |
| 49 | 53 | // payload is null because we can use closure scope in javascript | |
| 50 | 54 | NanUndefined() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments