[Pkg-javascript-commits] [backbone] 10/101: no more generated ids and fixed rake build

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 16:58:24 UTC 2014


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

js pushed a commit to tag 0.1.0
in repository backbone.

commit 232b0f8ac93b19d7140f39ed5f35253f674b2f6e
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Sat Oct 2 17:00:56 2010 -0400

    no more generated ids and fixed rake build
---
 Rakefile    | 4 +---
 backbone.js | 3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/Rakefile b/Rakefile
index 4564bc5..0a9212a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -3,8 +3,6 @@ require 'closure-compiler'
 
 desc "rebuild the backbone-min.js files for distribution"
 task :build do
-  files   = Dir['lib/*.js']
-  source  = files.map {|f| File.read f }.join "\n\n"
-  File.open('backbone.js', 'w+') {|f| f.write source }
+  source = File.read 'backbone.js'
   File.open('backbone-min.js', 'w+') {|f| f.write Closure::Compiler.new.compress(source) }
 end
\ No newline at end of file
diff --git a/backbone.js b/backbone.js
index e193ca3..437f637 100644
--- a/backbone.js
+++ b/backbone.js
@@ -96,7 +96,6 @@
   Backbone.Model = function(attributes) {
     this._attributes = {};
     attributes = attributes || {};
-    attributes.id = attributes.id || -_.uniqueId();
     this.set(attributes, true);
     this.cid = _.uniqueId('c');
     this._formerAttributes = this.attributes();
@@ -147,7 +146,7 @@
     // A model is new if it has never been saved to the server, and has a negative
     // ID.
     isNew : function() {
-      return this.id < 0;
+      return !this.id;
     },
 
     // Call this method to fire manually fire a `changed` event for this model.

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