| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 663f693 commit 2aff3c0
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -455,7 +455,7 @@ | |||
| 455 | 455 | ], | |
| 456 | 456 | "return": { | |
| 457 | 457 | "type": "int", | |
| 458 | - "noResults": 1, | ||
| 458 | + "noResults": 0, | ||
| 459 | 459 | "success": 0, | |
| 460 | 460 | "error": -1 | |
| 461 | 461 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,12 +14,12 @@ module.exports = function(fn, argReturnsOnly, isAsync) { | |||
| 14 | 14 | return_info.parsedClassName = (return_info.cppClassName || '').toLowerCase() + "_t"; | |
| 15 | 15 | return_info.returnNameOrName = return_info.returnName || return_info.name; | |
| 16 | 16 | return_info.jsOrCppClassName = return_info.jsClassName || return_info.cppClassName; | |
| 17 | + return_info.isOutParam = true; | ||
| 17 | 18 | ||
| 18 | 19 | result.push(return_info); | |
| 19 | 20 | }); | |
| 20 | 21 | ||
| 21 | 22 | if (!result.length | |
| 22 | - && !fn.isCallbackFunction | ||
| 23 | 23 | && !argReturnsOnly | |
| 24 | 24 | && fn.return | |
| 25 | 25 | && !fn.return.isErrorCode | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -86,16 +86,25 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_asyncAfter( | |||
| 86 | 86 | ||
| 87 | 87 | {{ cbFunction.return.type }} resultStatus; | |
| 88 | 88 | ||
| 89 | - {% each cbFunction|returnsInfo true false as _return %} | ||
| 89 | + {% each cbFunction|returnsInfo false true as _return %} | ||
| 90 | 90 | if (result.IsEmpty() || result->IsNativeError()) { | |
| 91 | 91 | baton->result = {{ cbFunction.return.error }}; | |
| 92 | 92 | } | |
| 93 | 93 | else if (!result->IsNull() && !result->IsUndefined()) { | |
| 94 | + {% if _return.isOutParam %} | ||
| 94 | 95 | {{ _return.cppClassName }}* wrapper = ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); | |
| 95 | 96 | wrapper->selfFreeing = false; | |
| 96 | 97 | ||
| 97 | 98 | baton->{{ _return.name }} = wrapper->GetRefValue(); | |
| 98 | 99 | baton->result = {{ cbFunction.return.success }}; | |
| 100 | + {% else %} | ||
| 101 | + if (result->IsNumber()) { | ||
| 102 | + baton->result = (int) result->ToNumber()->Value(); | ||
| 103 | + } | ||
| 104 | + else { | ||
| 105 | + baton->result = {{ cbFunction.return.noResults }}; | ||
| 106 | + } | ||
| 107 | + {% endif %} | ||
| 99 | 108 | } | |
| 100 | 109 | else { | |
| 101 | 110 | baton->result = {{ cbFunction.return.noResults }}; | |
@@ -126,16 +135,25 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_asyncPromis | |||
| 126 | 135 | Handle<v8::Value> result = resultFn->Call(0, argv); | |
| 127 | 136 | {{ cbFunction.return.type }} resultStatus; | |
| 128 | 137 | ||
| 129 | - {% each cbFunction|returnsInfo true false as _return %} | ||
| 138 | + {% each cbFunction|returnsInfo false true as _return %} | ||
| 130 | 139 | if (result.IsEmpty() || result->IsNativeError()) { | |
| 131 | 140 | baton->result = {{ cbFunction.return.error }}; | |
| 132 | 141 | } | |
| 133 | 142 | else if (!result->IsNull() && !result->IsUndefined()) { | |
| 143 | + {% if _return.isOutParam %} | ||
| 134 | 144 | {{ _return.cppClassName }}* wrapper = ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); | |
| 135 | 145 | wrapper->selfFreeing = false; | |
| 136 | 146 | ||
| 137 | 147 | baton->{{ _return.name }} = wrapper->GetRefValue(); | |
| 138 | 148 | baton->result = {{ cbFunction.return.success }}; | |
| 149 | + {% else %} | ||
| 150 | + if (result->IsNumber()) { | ||
| 151 | + baton->result = (int) result->ToNumber()->Value(); | ||
| 152 | + } | ||
| 153 | + else { | ||
| 154 | + baton->result = {{ cbFunction.return.noResults }}; | ||
| 155 | + } | ||
| 156 | + {% endif %} | ||
| 139 | 157 | } | |
| 140 | 158 | else { | |
| 141 | 159 | baton->result = {{ cbFunction.return.noResults }}; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,17 +19,17 @@ Index.prototype.entries = function() { | |||
| 19 | 19 | ||
| 20 | 20 | var addAll = Index.prototype.addAll; | |
| 21 | 21 | Index.prototype.addAll = function(pathspec, flags, matchedCallback) { | |
| 22 | - return addAll.call(this, pathspec, flags, matchedCallback, null); | ||
| 22 | + return addAll.call(this, pathspec || "*", flags, matchedCallback, null); | ||
| 23 | 23 | }; | |
| 24 | 24 | ||
| 25 | 25 | var removeAll = Index.prototype.removeAll; | |
| 26 | 26 | Index.prototype.removeAll = function(pathspec, matchedCallback) { | |
| 27 | - return removeAll.call(this, pathspec, matchedCallback, null); | ||
| 27 | + return removeAll.call(this, pathspec || "*", matchedCallback, null); | ||
| 28 | 28 | }; | |
| 29 | 29 | ||
| 30 | 30 | var updateAll = Index.prototype.updateAll; | |
| 31 | 31 | Index.prototype.updateAll = function(pathspec, matchedCallback) { | |
| 32 | - return updateAll.call(this, pathspec, matchedCallback, null); | ||
| 32 | + return updateAll.call(this, pathspec || "*", matchedCallback, null); | ||
| 33 | 33 | }; | |
| 34 | 34 | ||
| 35 | 35 | module.exports = Index; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,7 +62,7 @@ | |||
| 62 | 62 | "which-native-nodish": "^1.0.3" | |
| 63 | 63 | }, | |
| 64 | 64 | "devDependencies": { | |
| 65 | - "combyne": "^0.6.4", | ||
| 65 | + "combyne": "^0.6.5", | ||
| 66 | 66 | "istanbul": "^0.3.5", | |
| 67 | 67 | "js-beautify": "^1.5.4", | |
| 68 | 68 | "jshint": "^2.6.0", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments