From f9412b89e802682c76c1099d1c7a91d5e8ae135d Mon Sep 17 00:00:00 2001 From: zepumph Date: Thu, 19 Sep 2019 13:56:30 -0800 Subject: [PATCH] var -> const in require statements, use arrow function in define require call, https://github.com/phetsims/tasks/issues/1010 --- js/ActionIO.js | 2 +- js/BooleanPropertyTests.js | 4 ++-- js/DerivedPropertyTests.js | 6 +++--- js/DynamicPropertyTests.js | 6 +++--- js/EnumerationPropertyTests.js | 2 +- js/Events.js | 6 +++--- js/EventsTests.js | 4 ++-- js/Multilink.js | 6 +++--- js/NumberProperty.js | 2 +- js/NumberPropertyTests.js | 8 ++++---- js/ObservableArray.js | 16 ++++++++-------- js/ObservableArrayTests.js | 4 ++-- js/PropertyTests.js | 2 +- js/StringProperty.js | 2 +- js/StringPropertyTests.js | 6 +++--- js/TransactionTests.js | 4 ++-- js/axon.js | 4 ++-- js/units.js | 4 ++-- 18 files changed, 44 insertions(+), 44 deletions(-) diff --git a/js/ActionIO.js b/js/ActionIO.js index cb39c030..3a66f099 100644 --- a/js/ActionIO.js +++ b/js/ActionIO.js @@ -7,7 +7,7 @@ * @author Michael Kauzmann (PhET Interactive Simulations) * @author Andrew Adare (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules diff --git a/js/BooleanPropertyTests.js b/js/BooleanPropertyTests.js index 14161e9d..4f86211f 100644 --- a/js/BooleanPropertyTests.js +++ b/js/BooleanPropertyTests.js @@ -6,12 +6,12 @@ * @author Sam Reid (PhET Interactive Simulations) * @author Chris Malley (PixelZoom, Inc.) */ -define( function( require ) { +define( require => { 'use strict'; // modules const BooleanIO = require( 'TANDEM/types/BooleanIO' ); - var BooleanProperty = require( 'AXON/BooleanProperty' ); + const BooleanProperty = require( 'AXON/BooleanProperty' ); QUnit.module( 'BooleanProperty' ); QUnit.test( 'BooleanProperty', function( assert ) { diff --git a/js/DerivedPropertyTests.js b/js/DerivedPropertyTests.js index 6d360e49..0c984ce5 100644 --- a/js/DerivedPropertyTests.js +++ b/js/DerivedPropertyTests.js @@ -5,12 +5,12 @@ * * @author Sam Reid (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules - var DerivedProperty = require( 'AXON/DerivedProperty' ); - var Property = require( 'AXON/Property' ); + const DerivedProperty = require( 'AXON/DerivedProperty' ); + const Property = require( 'AXON/Property' ); QUnit.module( 'DerivedProperty' ); diff --git a/js/DynamicPropertyTests.js b/js/DynamicPropertyTests.js index ca5194f8..cb476338 100644 --- a/js/DynamicPropertyTests.js +++ b/js/DynamicPropertyTests.js @@ -5,12 +5,12 @@ * * @author Sam Reid (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules - var DynamicProperty = require( 'AXON/DynamicProperty' ); - var Property = require( 'AXON/Property' ); + const DynamicProperty = require( 'AXON/DynamicProperty' ); + const Property = require( 'AXON/Property' ); QUnit.module( 'DynamicProperty' ); diff --git a/js/EnumerationPropertyTests.js b/js/EnumerationPropertyTests.js index 853c9bfa..8c5be368 100644 --- a/js/EnumerationPropertyTests.js +++ b/js/EnumerationPropertyTests.js @@ -5,7 +5,7 @@ * * @author Chris Malley (PixelZoom, Inc.) */ -define( function( require ) { +define( require => { 'use strict'; // modules diff --git a/js/Events.js b/js/Events.js index 1ab14bd7..09cc9267 100644 --- a/js/Events.js +++ b/js/Events.js @@ -6,12 +6,12 @@ * @deprecated - use Emitter.js instead * @author Sam Reid (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules - var axon = require( 'AXON/axon' ); - var cleanArray = require( 'PHET_CORE/cleanArray' ); + const axon = require( 'AXON/axon' ); + const cleanArray = require( 'PHET_CORE/cleanArray' ); /** * @constructor diff --git a/js/EventsTests.js b/js/EventsTests.js index 74f0379d..1554b629 100644 --- a/js/EventsTests.js +++ b/js/EventsTests.js @@ -5,11 +5,11 @@ * * @author Sam Reid (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules - var Events = require( 'AXON/Events' ); + const Events = require( 'AXON/Events' ); QUnit.module( 'Events' ); diff --git a/js/Multilink.js b/js/Multilink.js index 3a931f14..552b2158 100644 --- a/js/Multilink.js +++ b/js/Multilink.js @@ -8,12 +8,12 @@ * * @author Sam Reid (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules - var axon = require( 'AXON/axon' ); - var inherit = require( 'PHET_CORE/inherit' ); + const axon = require( 'AXON/axon' ); + const inherit = require( 'PHET_CORE/inherit' ); /** * @param {Property[]} dependencies diff --git a/js/NumberProperty.js b/js/NumberProperty.js index 1e797ca1..5dfdb266 100644 --- a/js/NumberProperty.js +++ b/js/NumberProperty.js @@ -6,7 +6,7 @@ * @author Chris Malley (PixelZoom, Inc.) * @author Sam Reid (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules diff --git a/js/NumberPropertyTests.js b/js/NumberPropertyTests.js index db81d063..5c3076e0 100644 --- a/js/NumberPropertyTests.js +++ b/js/NumberPropertyTests.js @@ -6,13 +6,13 @@ * @author Sam Reid (PhET Interactive Simulations) * @author Chris Malley (PixelZoom, Inc.) */ -define( function( require ) { +define( require => { 'use strict'; // modules - var NumberIO = require( 'TANDEM/types/NumberIO' ); - var NumberProperty = require( 'AXON/NumberProperty' ); - var Range = require( 'DOT/Range' ); + const NumberIO = require( 'TANDEM/types/NumberIO' ); + const NumberProperty = require( 'AXON/NumberProperty' ); + const Range = require( 'DOT/Range' ); QUnit.module( 'NumberProperty' ); diff --git a/js/ObservableArray.js b/js/ObservableArray.js index 8b716be4..7e35be4d 100644 --- a/js/ObservableArray.js +++ b/js/ObservableArray.js @@ -9,17 +9,17 @@ * @author Sam Reid (PhET Interactive Simulations) * @author Chris Malley (PixelZoom, Inc.) */ -define( function( require ) { +define( require => { 'use strict'; // modules - var axon = require( 'AXON/axon' ); - var inherit = require( 'PHET_CORE/inherit' ); - var NumberProperty = require( 'AXON/NumberProperty' ); - var ObjectIO = require( 'TANDEM/types/ObjectIO' ); - var ObservableArrayIO = require( 'AXON/ObservableArrayIO' ); - var PhetioObject = require( 'TANDEM/PhetioObject' ); - var Tandem = require( 'TANDEM/Tandem' ); + const axon = require( 'AXON/axon' ); + const inherit = require( 'PHET_CORE/inherit' ); + const NumberProperty = require( 'AXON/NumberProperty' ); + const ObjectIO = require( 'TANDEM/types/ObjectIO' ); + const ObservableArrayIO = require( 'AXON/ObservableArrayIO' ); + const PhetioObject = require( 'TANDEM/PhetioObject' ); + const Tandem = require( 'TANDEM/Tandem' ); // Factor out to reduce memory footprint, see https://github.com/phetsims/tandem/issues/71 var DefaultObservableArrayIOType = ObservableArrayIO( ObjectIO ); diff --git a/js/ObservableArrayTests.js b/js/ObservableArrayTests.js index c70ef71b..af0f5aeb 100644 --- a/js/ObservableArrayTests.js +++ b/js/ObservableArrayTests.js @@ -5,11 +5,11 @@ * * @author Sam Reid (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules - var ObservableArray = require( 'AXON/ObservableArray' ); + const ObservableArray = require( 'AXON/ObservableArray' ); QUnit.module( 'Observable Array' ); diff --git a/js/PropertyTests.js b/js/PropertyTests.js index 945b64c4..b8d76bb5 100644 --- a/js/PropertyTests.js +++ b/js/PropertyTests.js @@ -5,7 +5,7 @@ * * @author Sam Reid (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules diff --git a/js/StringProperty.js b/js/StringProperty.js index 7fa8d7ad..6c4e9f00 100644 --- a/js/StringProperty.js +++ b/js/StringProperty.js @@ -6,7 +6,7 @@ * @author Sam Reid (PhET Interactive Simulations) * @author Chris Malley (PixelZoom, Inc.) */ -define( function( require ) { +define( require => { 'use strict'; // modules diff --git a/js/StringPropertyTests.js b/js/StringPropertyTests.js index c7d2d593..7ae30360 100644 --- a/js/StringPropertyTests.js +++ b/js/StringPropertyTests.js @@ -6,12 +6,12 @@ * @author Sam Reid (PhET Interactive Simulations) * @author Chris Malley (PixelZoom, Inc.) */ -define( function( require ) { +define( require => { 'use strict'; // modules - var StringIO = require( 'TANDEM/types/StringIO' ); - var StringProperty = require( 'AXON/StringProperty' ); + const StringIO = require( 'TANDEM/types/StringIO' ); + const StringProperty = require( 'AXON/StringProperty' ); QUnit.module( 'StringProperty' ); QUnit.test( 'Test StringProperty', function( assert ) { diff --git a/js/TransactionTests.js b/js/TransactionTests.js index 7c781276..368f1dce 100644 --- a/js/TransactionTests.js +++ b/js/TransactionTests.js @@ -5,7 +5,7 @@ * * @author Sam Reid (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules @@ -14,7 +14,7 @@ define( function( require ) { const NumberIO = require( 'TANDEM/types/NumberIO' ); const NumberProperty = require( 'AXON/NumberProperty' ); const Tandem = require( 'TANDEM/Tandem' ); - var Transaction = require( 'AXON/Transaction' ); + const Transaction = require( 'AXON/Transaction' ); QUnit.module( 'Transaction' ); diff --git a/js/axon.js b/js/axon.js index 0b19148f..fa50f6d0 100644 --- a/js/axon.js +++ b/js/axon.js @@ -1,9 +1,9 @@ // Copyright 2013-2019, University of Colorado Boulder -define( function( require ) { +define( require => { 'use strict'; - var Namespace = require( 'PHET_CORE/Namespace' ); + const Namespace = require( 'PHET_CORE/Namespace' ); return new Namespace( 'axon' ); } ); diff --git a/js/units.js b/js/units.js index c3bb6896..5f95632c 100644 --- a/js/units.js +++ b/js/units.js @@ -5,11 +5,11 @@ * * @author Sam Reid (PhET Interactive Simulations) */ -define( function( require ) { +define( require => { 'use strict'; // modules - var axon = require( 'AXON/axon' ); + const axon = require( 'AXON/axon' ); var units = { values: [