From 0d6b589e3674e0dccd013aa4790651fad81a6e78 Mon Sep 17 00:00:00 2001 From: samreid Date: Wed, 6 Jul 2016 16:16:39 -0600 Subject: [PATCH] Simplified _.extend call and clarified assert messages, see #243 --- js/buttons/StepBackwardButton.js | 4 ++-- js/buttons/StepForwardButton.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/buttons/StepBackwardButton.js b/js/buttons/StepBackwardButton.js index 10ef37b5b..dfaf601b7 100644 --- a/js/buttons/StepBackwardButton.js +++ b/js/buttons/StepBackwardButton.js @@ -18,8 +18,8 @@ define( function( require ) { * @constructor */ function StepBackwardButton( options ) { - assert && assert( !options.direction, 'options.direction must not be specified for StepBackwardButton' ); - StepButton.call( this, _.extend( {}, options, { direction: 'backward' } ) ); + assert && assert( !options.direction, 'options.direction must be omitted for StepBackwardButton' ); + StepButton.call( this, _.extend( { direction: 'backward' }, options ) ); } sceneryPhet.register( 'StepBackwardButton', StepBackwardButton ); diff --git a/js/buttons/StepForwardButton.js b/js/buttons/StepForwardButton.js index 7c154e6dc..0c0d98d44 100644 --- a/js/buttons/StepForwardButton.js +++ b/js/buttons/StepForwardButton.js @@ -19,8 +19,8 @@ define( function( require ) { * @constructor */ function StepForwardButton( options ) { - assert && assert( !options.direction, 'options.direction must not be specified for StepForwardButton' ); - StepButton.call( this, _.extend( {}, options, { direction: 'forward' } ) ); + assert && assert( !options.direction, 'options.direction must be omitted for StepForwardButton' ); + StepButton.call( this, _.extend( { direction: 'forward' }, options ) ); } sceneryPhet.register( 'StepForwardButton', StepForwardButton );