[Pkg-javascript-commits] [backbone] 176/211: ouch, leaking global attrs. (shakes fist)

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:00:21 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.5.0
in repository backbone.

commit ff57b6536dd4f5ff9fa27cc1449a1eba196eb975
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Fri May 27 12:17:10 2011 -0400

    ouch, leaking global attrs. (shakes fist)
---
 backbone.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/backbone.js b/backbone.js
index 8833384..6005ce0 100644
--- a/backbone.js
+++ b/backbone.js
@@ -103,13 +103,13 @@
     // same arguments as `trigger` is, apart from the event name.
     // Listening for `"all"` passes the true event name as the first argument.
     trigger : function(eventName) {
-      var list, calls, ev, callback, args, i, l;
+      var list, calls, ev, callback, args;
       var both = 2;
       if (!(calls = this._callbacks)) return this;
       while (both--) {
         ev = both ? eventName : 'all';
         if (list = calls[ev]) {
-          for (i = 0, l = list.length; i < l; i++) {
+          for (var i = 0, l = list.length; i < l; i++) {
             if (!(callback = list[i])) {
               list.splice(i, 1); i--; l--;
             } else {
@@ -257,14 +257,14 @@
 
       // Run validation.
       var validObj = {};
-      for (attr in old) validObj[attr] = void 0;
+      for (var attr in old) validObj[attr] = void 0;
       if (!options.silent && this.validate && !this._performValidation(validObj, options)) return false;
 
       this.attributes = {};
       this._escapedAttributes = {};
       this._changed = true;
       if (!options.silent) {
-        for (attr in old) {
+        for (var attr in old) {
           this.trigger('change:' + attr, this, void 0, options);
         }
         this.change(options);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list