You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2015/07/16 23:53:11 UTC
thrift git commit: THRIFT-3244 TypeScript: fix namespace of imported
types
Repository: thrift
Updated Branches:
refs/heads/master ecc2a6b60 -> e15ade77c
THRIFT-3244 TypeScript: fix namespace of imported types
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/e15ade77
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/e15ade77
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/e15ade77
Branch: refs/heads/master
Commit: e15ade77cbb4578f74b6208f98e5380bb9bd071c
Parents: ecc2a6b
Author: Frederik Gladhorn <fr...@theqtcompany.com>
Authored: Tue Jul 14 22:23:17 2015 +0200
Committer: Roger Meier <r....@siemens.com>
Committed: Thu Jul 16 23:52:42 2015 +0200
----------------------------------------------------------------------
compiler/cpp/src/generate/t_js_generator.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/e15ade77/compiler/cpp/src/generate/t_js_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/generate/t_js_generator.cc b/compiler/cpp/src/generate/t_js_generator.cc
index af66ade..8e136c4 100644
--- a/compiler/cpp/src/generate/t_js_generator.cc
+++ b/compiler/cpp/src/generate/t_js_generator.cc
@@ -2100,7 +2100,12 @@ string t_js_generator::ts_get_type(t_type* type) {
ts_type = "void";
}
} else if (type->is_enum() || type->is_struct() || type->is_xception()) {
- ts_type = type->get_name();
+ std::string type_name;
+ if (type->get_program()) {
+ type_name = js_namespace(type->get_program());
+ }
+ type_name.append(type->get_name());
+ ts_type = type_name;
} else if (type->is_list() || type->is_set()) {
t_type* etype;