From 83c81005fecdaa4c6550cafa40d2607bc516ae03 Mon Sep 17 00:00:00 2001 From: Casey Foster Date: Fri, 28 Feb 2014 12:26:26 -0600 Subject: [PATCH] Re #3029 Guard against unavailable edge underscore proxies --- backbone.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backbone.js b/backbone.js index ff7738f3..6bb95d9e 100644 --- a/backbone.js +++ b/backbone.js @@ -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);