From: Jake Farrell Date: Mon, 21 Nov 2011 13:52:51 +0000 (+0000) Subject: Thrift-1432: Javascript struct constants declared in the same file as their struct... X-Git-Tag: 0.8.0~9 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=a6c031ad41716173007677dda5e244d7b1314a3d;p=common%2Fthrift.git Thrift-1432: Javascript struct constants declared in the same file as their struct definition will cause an error Client: js Patch: Mike Riley Flips print out of constants and structs within the generator to allow for use of constants within the structs. git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1204495 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/compiler/cpp/src/generate/t_generator.cc b/compiler/cpp/src/generate/t_generator.cc index c91929c7..67a3e785 100644 --- a/compiler/cpp/src/generate/t_generator.cc +++ b/compiler/cpp/src/generate/t_generator.cc @@ -45,10 +45,6 @@ void t_generator::generate_program() { generate_typedef(*td_iter); } - // Generate constants - vector consts = program_->get_consts(); - generate_consts(consts); - // Generate structs, exceptions, and unions in declared order vector objects = program_->get_objects(); vector::iterator o_iter; @@ -60,6 +56,10 @@ void t_generator::generate_program() { } } + // Generate constants + vector consts = program_->get_consts(); + generate_consts(consts); + // Generate services vector services = program_->get_services(); vector::iterator sv_iter;