Skip to content

Commit

Permalink
Use slice helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed Jul 16, 2014
1 parent 7e9b0e5 commit 03bafab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/marionette.collectionview.js
Expand Up @@ -445,7 +445,7 @@ Marionette.CollectionView = Marionette.View.extend({
// Forward all child view events through the parent,
// prepending "childview:" to the event name
this.listenTo(view, 'all', function() {
var args = Array.prototype.slice.call(arguments);
var args = slice.call(arguments);
var rootEvent = args[0];
var childEvents = this.normalizeMethods(_.result(this, 'childEvents'));

Expand Down
2 changes: 1 addition & 1 deletion src/marionette.controller.js
Expand Up @@ -20,7 +20,7 @@ Marionette.Controller.extend = Marionette.extend;
// Ensure it can trigger events with Backbone.Events
_.extend(Marionette.Controller.prototype, Backbone.Events, {
destroy: function() {
var args = Array.prototype.slice.call(arguments);
var args = slice.call(arguments);
this.triggerMethod.apply(this, ['before:destroy'].concat(args));
this.triggerMethod.apply(this, ['destroy'].concat(args));

Expand Down
2 changes: 1 addition & 1 deletion src/marionette.region.js
Expand Up @@ -20,7 +20,7 @@ Marionette.Region = function(options) {
this.$el = this.getEl(this.el);

if (this.initialize) {
var args = Array.prototype.slice.apply(arguments);
var args = slice.apply(arguments);
this.initialize.apply(this, args);
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/marionette.view.js
Expand Up @@ -141,7 +141,7 @@ Marionette.View = Backbone.View.extend({
// Overriding Backbone.View's undelegateEvents to handle unbinding
// the `triggers`, `modelEvents`, and `collectionEvents` config
undelegateEvents: function() {
var args = Array.prototype.slice.call(arguments);
var args = slice.call(arguments);
Backbone.View.prototype.undelegateEvents.apply(this, args);
this.unbindEntityEvents(this.model, this.getOption('modelEvents'));
this.unbindEntityEvents(this.collection, this.getOption('collectionEvents'));
Expand All @@ -167,7 +167,7 @@ Marionette.View = Backbone.View.extend({
destroy: function() {
if (this.isDestroyed) { return; }

var args = Array.prototype.slice.call(arguments);
var args = slice.call(arguments);

this.triggerMethod.apply(this, ['before:destroy'].concat(args));

Expand Down

0 comments on commit 03bafab

Please sign in to comment.