[Pkg-javascript-commits] [backbone] 110/211: Upgrading to Underscore 1.1.6 for test deps.
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 17:00:10 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 7b494c1e6def093bfb3914ea299c5ab5d0f7a3ab
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date: Mon Apr 18 09:19:04 2011 -0400
Upgrading to Underscore 1.1.6 for test deps.
---
examples/todos/index.html | 2 +-
index.html | 2 +-
test/test-zepto.html | 2 +-
test/test.html | 2 +-
.../{underscore-1.1.5.js => underscore-1.1.6.js} | 32 +++++++++++++++-------
5 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/examples/todos/index.html b/examples/todos/index.html
index d3ef3c4..7f1c20f 100644
--- a/examples/todos/index.html
+++ b/examples/todos/index.html
@@ -6,7 +6,7 @@
<link href="todos.css" media="all" rel="stylesheet" type="text/css"/>
<script src="../../test/vendor/json2.js"></script>
<script src="../../test/vendor/jquery-1.5.js"></script>
- <script src="../../test/vendor/underscore-1.1.5.js"></script>
+ <script src="../../test/vendor/underscore-1.1.6.js"></script>
<script src="../../backbone.js"></script>
<script src="../backbone-localstorage.js"></script>
<script src="todos.js"></script>
diff --git a/index.html b/index.html
index b5907b5..6d696a7 100644
--- a/index.html
+++ b/index.html
@@ -2255,7 +2255,7 @@ Inbox.messages.add(newMessage);
</div>
- <script src="test/vendor/underscore-1.1.5.js"></script>
+ <script src="test/vendor/underscore-1.1.6.js"></script>
<script src="test/vendor/jquery-1.5.js"></script>
<script src="test/vendor/json2.js"></script>
<script src="backbone.js"></script>
diff --git a/test/test-zepto.html b/test/test-zepto.html
index 4f7ad91..2b090e5 100644
--- a/test/test-zepto.html
+++ b/test/test-zepto.html
@@ -7,7 +7,7 @@
<script type="text/javascript" src="vendor/zepto-0.5.js"></script>
<script type="text/javascript" src="vendor/qunit.js"></script>
<script type="text/javascript" src="vendor/jslitmus.js"></script>
- <script type="text/javascript" src="vendor/underscore-1.1.5.js"></script>
+ <script type="text/javascript" src="vendor/underscore-1.1.6.js"></script>
<script type="text/javascript" src="../backbone.js"></script>
<script type="text/javascript" src="events.js"></script>
diff --git a/test/test.html b/test/test.html
index d350ad2..b654ad5 100644
--- a/test/test.html
+++ b/test/test.html
@@ -7,7 +7,7 @@
<script type="text/javascript" src="vendor/jquery-1.5.js"></script>
<script type="text/javascript" src="vendor/qunit.js"></script>
<script type="text/javascript" src="vendor/jslitmus.js"></script>
- <script type="text/javascript" src="vendor/underscore-1.1.5.js"></script>
+ <script type="text/javascript" src="vendor/underscore-1.1.6.js"></script>
<script type="text/javascript" src="../backbone.js"></script>
<script type="text/javascript" src="events.js"></script>
diff --git a/test/vendor/underscore-1.1.5.js b/test/vendor/underscore-1.1.6.js
similarity index 96%
rename from test/vendor/underscore-1.1.5.js
rename to test/vendor/underscore-1.1.6.js
index c627740..eaba008 100644
--- a/test/vendor/underscore-1.1.5.js
+++ b/test/vendor/underscore-1.1.6.js
@@ -1,4 +1,4 @@
-// Underscore.js 1.1.5
+// Underscore.js 1.1.6
// (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
@@ -59,7 +59,7 @@
}
// Current version.
- _.VERSION = '1.1.5';
+ _.VERSION = '1.1.6';
// Collection Functions
// --------------------
@@ -168,7 +168,6 @@
// Delegates to **ECMAScript 5**'s native `every` if available.
// Aliased as `all`.
_.every = _.all = function(obj, iterator, context) {
- iterator = iterator || _.identity;
var result = true;
if (obj == null) return result;
if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
@@ -182,7 +181,7 @@
// Delegates to **ECMAScript 5**'s native `some` if available.
// Aliased as `any`.
var any = _.some = _.any = function(obj, iterator, context) {
- iterator = iterator || _.identity;
+ iterator || (iterator = _.identity);
var result = false;
if (obj == null) return result;
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
@@ -208,7 +207,7 @@
_.invoke = function(obj, method) {
var args = slice.call(arguments, 2);
return _.map(obj, function(value) {
- return (method ? value[method] : value).apply(value, args);
+ return (method.call ? method || value : value[method]).apply(value, args);
});
};
@@ -255,7 +254,7 @@
// Use a comparator function to figure out at what index an object should
// be inserted so as to maintain order. Uses binary search.
_.sortedIndex = function(array, obj, iterator) {
- iterator = iterator || _.identity;
+ iterator || (iterator = _.identity);
var low = 0, high = array.length;
while (low < high) {
var mid = (low + high) >> 1;
@@ -408,8 +407,9 @@
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Binding with arguments is also known as `curry`.
// Delegates to **ECMAScript 5**'s native `Function.bind` if available.
+ // We check for `func.bind` first, to fail fast when `func` is undefined.
_.bind = function(func, obj) {
- if (nativeBind && func.bind === nativeBind) return func.bind.apply(func, slice.call(arguments, 1));
+ if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
var args = slice.call(arguments, 2);
return function() {
return func.apply(obj, args.concat(slice.call(arguments)));
@@ -428,7 +428,7 @@
// Memoize an expensive function by storing its results.
_.memoize = function(func, hasher) {
var memo = {};
- hasher = hasher || _.identity;
+ hasher || (hasher = _.identity);
return function() {
var key = hasher.apply(this, arguments);
return hasOwnProperty.call(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
@@ -509,6 +509,14 @@
};
};
+ // Returns a function that will only be executed after being called N times.
+ _.after = function(times, func) {
+ return function() {
+ if (--times < 1) { return func.apply(this, arguments); }
+ };
+ };
+
+
// Object Functions
// ----------------
@@ -535,7 +543,9 @@
// Extend a given object with all the properties in passed-in object(s).
_.extend = function(obj) {
each(slice.call(arguments, 1), function(source) {
- for (var prop in source) obj[prop] = source[prop];
+ for (var prop in source) {
+ if (source[prop] !== void 0) obj[prop] = source[prop];
+ }
});
return obj;
};
@@ -543,7 +553,9 @@
// Fill in a given object with default properties.
_.defaults = function(obj) {
each(slice.call(arguments, 1), function(source) {
- for (var prop in source) if (obj[prop] == null) obj[prop] = source[prop];
+ for (var prop in source) {
+ if (obj[prop] == null) obj[prop] = source[prop];
+ }
});
return obj;
};
--
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