jimexist commented on code in PR #3528:
URL: https://github.com/apache/thrift/pull/3528#discussion_r3295711442
##########
compiler/cpp/src/thrift/generate/t_js_generator.cc:
##########
@@ -1570,7 +1590,7 @@ void t_js_generator::generate_process_function(t_service*
tservice, t_function*
<< ".length === " << fields.size() << ") {" << '\n';
indent_up();
- if (gen_es6_) {
+ if (gen_es6_ || gen_native_promise_) {
indent(f_service_) << "new Promise((resolve) => resolve(this._handler." <<
tfunction->get_name() << ".bind(this._handler)(" << '\n';
} else {
Review Comment:
Fixed in 7c3f37992: non-ES6 + native_promise now emits `new
Promise(function(resolve) { resolve(...); }.bind(this))` instead of an arrow
function, keeping the output ES5-compatible while binding `this` explicitly.
##########
lib/nodets/test/test_driver.ts:
##########
@@ -149,7 +148,7 @@ export function ThriftTestDriverPromise(
.then(function (actual: any) {
assertionFn(actual, expected, fnName);
})
- .fail(fail("fnName"));
+ .catch(fail("fnName"));
Review Comment:
Fixed in 7c3f37992: changed `fail("fnName")` to `fail(fnName)` so the
failure message reports the actual RPC name.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]