[Pkg-javascript-commits] [backbone] 196/281: allow the passing of any number of arguments to Model#initialize

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:02:12 UTC 2014


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

js pushed a commit to tag 0.9.0
in repository backbone.

commit 4316b04ffa75257e9eec9fe46b3c48535b659936
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Fri Jan 13 16:10:14 2012 -0500

    allow the passing of any number of arguments to Model#initialize
---
 backbone.js   | 2 +-
 test/model.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/backbone.js b/backbone.js
index 965c5ba..c5d6796 100644
--- a/backbone.js
+++ b/backbone.js
@@ -158,7 +158,7 @@
     this.set(attributes, {silent : true});
     this._changed = false;
     this._previousAttributes = _.clone(this.attributes);
-    this.initialize(attributes, options);
+    this.initialize.apply(this, arguments);
   };
 
   // Attach all inheritable methods to the Model prototype.
diff --git a/test/model.js b/test/model.js
index afac04f..ea7ac80 100644
--- a/test/model.js
+++ b/test/model.js
@@ -424,7 +424,7 @@ $(document).ready(function() {
     var Defaulted = Backbone.Model.extend({
       defaults: {one: 1},
       initialize : function(attrs, opts) {
-        equals(attrs.one, 1);
+        equals(this.attributes.one, 1);
       }
     });
     var providedattrs = new Defaulted({});

-- 
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