You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Roger Meier (JIRA)" <ji...@apache.org> on 2011/05/22 12:03:47 UTC
[jira] [Resolved] (THRIFT-1176) Thrift compiler global leakage js
[ https://issues.apache.org/jira/browse/THRIFT-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Roger Meier resolved THRIFT-1176.
---------------------------------
Resolution: Fixed
Fix Version/s: (was: 0.6)
Assignee: Roger Meier
committed!
includes updated test.html to get qunit.js with correct mime-type(IE9 complains if not), fixed by myself
> Thrift compiler global leakage js
> ---------------------------------
>
> Key: THRIFT-1176
> URL: https://issues.apache.org/jira/browse/THRIFT-1176
> Project: Thrift
> Issue Type: Bug
> Components: Node.js - Compiler
> Affects Versions: 0.6
> Reporter: Dan Di Spaltro
> Assignee: Roger Meier
> Priority: Trivial
>
> Below I added the var qualifier on the declare field function. This is fairly trivial and fixes the global scope leak.
> {code}
> diff --git a/compiler/cpp/src/generate/t_js_generator.cc b/compiler/cpp/src/generate/t_js_generator.cc
> index a654fc9..c4f201f 100644
> --- a/compiler/cpp/src/generate/t_js_generator.cc
> +++ b/compiler/cpp/src/generate/t_js_generator.cc
> @@ -1623,7 +1623,7 @@ string t_js_generator::declare_field(t_field* tfield, bool init, bool obj) {
> string result = "this." + tfield->get_name();
>
> if(!obj){
> - result = tfield->get_name();
> + result = "var " + tfield->get_name();
> }
>
> if (init) {
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira