THRIFT-1176 Thrift compiler global leakage js
Patch: Dan Di Spaltro

includes updated test.html to get qunit.js with correct mime-type(IE9 complains)
Fixed by Roger Meier


git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1125892 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/generate/t_js_generator.cc b/compiler/cpp/src/generate/t_js_generator.cc
index 7059765..6c61890 100644
--- a/compiler/cpp/src/generate/t_js_generator.cc
+++ b/compiler/cpp/src/generate/t_js_generator.cc
@@ -1645,7 +1645,7 @@
   string result = "this." + tfield->get_name();
 
   if(!obj){
-      result = tfield->get_name();
+      result = "var " + tfield->get_name();
   }
 
   if (init) {
diff --git a/lib/js/test/test.html b/lib/js/test/test.html
index f99da01..505991f 100644
--- a/lib/js/test/test.html
+++ b/lib/js/test/test.html
@@ -33,8 +33,8 @@
   <script type="text/javascript" src="json2.js" charset="utf-8"></script>
 
   <!-- QUnit Test framework-->
-  <script type="text/javascript" src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js" charset="utf-8"></script>
-  <link rel="stylesheet" href="http://github.com/jquery/qunit/raw/master/qunit/qunit.css" type="text/css" media="screen" />
+  <script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js" charset="utf-8"></script>
+  <link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" />
 
   <script type="text/javascript" charset="utf-8">
   //<![CDATA[