Re #3029 Guard against unavailable edge underscore proxies

This commit is contained in:
Casey Foster
2014-02-28 12:26:26 -06:00
parent 1853297cc9
commit 83c81005fe

View File

@@ -597,6 +597,7 @@
// Mix in each Underscore method as a proxy to `Model#attributes`.
_.each(modelMethods, function(method) {
if (!_[method]) return;
Model.prototype[method] = function() {
var args = slice.call(arguments);
args.unshift(this.attributes);
@@ -978,6 +979,7 @@
// Mix in each Underscore method as a proxy to `Collection#models`.
_.each(methods, function(method) {
if (!_[method]) return;
Collection.prototype[method] = function() {
var args = slice.call(arguments);
args.unshift(this.models);
@@ -990,6 +992,7 @@
// Use attributes instead of properties.
_.each(attributeMethods, function(method) {
if (!_[method]) return;
Collection.prototype[method] = function(value, context) {
var iterator = _.isFunction(value) ? value : function(model) {
return model.get(value);