8000 Update vendors. · lodash/lodash@48c13c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 48c13c9

Browse files
committed
Update vendors.
Former-commit-id: f2a09b6501a34b2ae2d8e996b13c9da4fb048535
1 parent a266552 commit 48c13c9

File tree

4 files changed

+50
-38
lines changed

4 files changed

+50
-38
lines changed

vendor/backbone/backbone.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -791,14 +791,14 @@
791791
// collection immediately, unless `wait: true` is passed, in which case we
792792
// wait for the server to agree.
793793
create: function(model, options) {
794-
var coll = this;
794+
var collection = this;
795795
options = options ? _.clone(options) : {};
796796
model = this._prepareModel(model, options);
797797
if (!model) return false;
798-
if (!options.wait) coll.add(model, options);
798+
if (!options.wait) collection.add(model, options);
799799
var success = options.success;
800800
options.success = function(model, resp, options) {
801-
if (options.wait) coll.add(model, options);
801+
if (options.wait) collection.add(model, options);
802802
if (success) success(model, resp, options);
803803
};
804804
model.save(null, options);
@@ -1314,14 +1314,6 @@
13141314

13151315
});
13161316

1317-
// The self-propagating extend function that Backbone classes use.
1318-
var extend = function(protoProps, classProps) {
1319-
return inherits(this, protoProps, classProps);
1320-
};
1321-
1322-
// Set up inheritance for the model, collection, and view.
1323-
Model.extend = Collection.extend = Router.extend = View.extend = extend;
1324-
13251317
// Backbone.sync
13261318
// -------------
13271319

@@ -1421,7 +1413,8 @@
14211413
// Helper function to correctly set up the prototype chain, for subclasses.
14221414
// Similar to `goog.inherits`, but uses a hash of prototype properties and
14231415
// class properties to be extended.
1424-
var inherits = function(parent, protoProps, staticProps) {
1416+
var extend = function(protoProps, staticProps) {
1417+
var parent = this;
14251418
var child;
14261419

14271420
// The constructor function for the new subclass is either defined by you
@@ -1457,6 +1450,9 @@
14571450
return child;
14581451
};
14591452

1453+
// Set up inheritance for the model, collection, and view.
1454+
Model.extend = Collection.extend = Router.extend = View.extend = extend;
1455+
14601456
// Helper function to get a value from a Backbone object as a property
14611457
// or as a function.
14621458
var getValue = function(object, prop) {

vendor/underscore/test/objects.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ $(document).ready(function() {
5050
ok(_.isEqual(result, {a:1, b:2}), 'can restrict properties to those named in mixed args');
5151
});
5252

53+
test("objects: omit", function() {
54+
var result;
55+
result = _.omit({a:1, b:2, c:3}, 'b');
56+
ok(_.isEqual(result, {a:1, c:3}), 'can omit a single named property');
57+
result = _.omit({a:1, b:2, c:3}, 'a', 'c');
58+
ok(_.isEqual(result, {b:2}), 'can omit several named properties');
59+
result = _.omit({a:1, b:2, c:3}, ['b', 'c']);
60+
ok(_.isEqual(result, {a:1}), 'can omit properties named in an array');
61+
});
62+
5363
test("objects: defaults", function() {
5464
var result;
5565
var options = {zero: 0, one: 1, empty: "", nan: NaN, string: "string"};

0 commit comments

Comments
 (0)
0