[LNT] r264724 - [ui/js] Demote an accidental global to a local

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 05:11:34 PDT 2016


Author: jamesm
Date: Tue Mar 29 07:11:34 2016
New Revision: 264724

URL: http://llvm.org/viewvc/llvm-project?rev=264724&view=rev
Log:
[ui/js] Demote an accidental global to a local

If you take a copy of "this" and make it global instead of local, bad things can happen when you have more than one object!

Modified:
    lnt/trunk/lnt/server/ui/static/lnt_run.js

Modified: lnt/trunk/lnt/server/ui/static/lnt_run.js
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/lnt_run.js?rev=264724&r1=264723&r2=264724&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/static/lnt_run.js (original)
+++ lnt/trunk/lnt/server/ui/static/lnt_run.js Tue Mar 29 07:11:34 2016
@@ -3,7 +3,7 @@ function RunTypeahead(element, options)
     this.options = options;
     this.id = null;
 
-    this_ = this;
+    var this_ = this;
     element.typeahead({
         source: function(query, process) {
             $.ajax(options.searchURL, {
@@ -34,7 +34,6 @@ function RunTypeahead(element, options)
             name = item.split(',')[0];
             id = item.split(',')[1];
             this_.id = id;
-            
             if (options.updated)
                 options.updated(name, id);
             return name;
@@ -137,7 +136,6 @@ function makeEditable(type, td) {
                 document.location.href = url;
             },
             cleared: function()  {
-                console.log("jjg");
             }
         });
         title.children('span').first().click(function() {




More information about the llvm-commits mailing list