You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2017/07/30 10:00:20 UTC

thrift git commit: THRIFT-4257 Typescript async callbacks do not provide the correct types Client: Typescript Patch: Mike Morton

Repository: thrift
Updated Branches:
  refs/heads/master ed9e75f62 -> 3ba4ecf3e


THRIFT-4257 Typescript async callbacks do not provide the correct types
Client: Typescript
Patch: Mike Morton <mi...@gmail.com>

This closes #1310


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/3ba4ecf3
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/3ba4ecf3
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/3ba4ecf3

Branch: refs/heads/master
Commit: 3ba4ecf3e0a4e2b4fde0cc6e48f672d95d732ba5
Parents: ed9e75f
Author: Mike Morton <mi...@gmail.com>
Authored: Wed Jul 19 09:23:43 2017 -0400
Committer: Jens Geyer <je...@apache.org>
Committed: Sun Jul 30 12:00:06 2017 +0200

----------------------------------------------------------------------
 compiler/cpp/src/thrift/generate/t_js_generator.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/3ba4ecf3/compiler/cpp/src/thrift/generate/t_js_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/thrift/generate/t_js_generator.cc b/compiler/cpp/src/thrift/generate/t_js_generator.cc
index 856f75c..57ec88e 100644
--- a/compiler/cpp/src/thrift/generate/t_js_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_js_generator.cc
@@ -2218,10 +2218,10 @@ std::string t_js_generator::ts_function_signature(t_function* tfunction, bool in
   }
 
   if (include_callback) {
-    str += "callback: Function): ";
+    str += "callback: (data: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
 
     if (gen_jquery_) {
-      str += "JQueryXHR;";
+      str += "JQueryPromise<" + ts_get_type(tfunction->get_returntype()) +">;";
     } else {
       str += "void;";
     }