Skip to content

Commit

Permalink
var -> const in require statements, use arrow function in define requ…
Browse files Browse the repository at this point in the history
…ire call, phetsims/tasks#1010
  • Loading branch information
zepumph committed Sep 19, 2019
1 parent f51a3b2 commit 97f2f4c
Show file tree
Hide file tree
Showing 58 changed files with 185 additions and 185 deletions.
12 changes: 6 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright 2013-2016, University of Colorado Boulder

var esprima = require( 'esprima' );
var jsBeautify = require( 'js-beautify' ); // eslint-disable-line require-statement-match
var extractDocumentation = require( '../chipper/js/common/extractDocumentation' );
var documentationToHTML = require( '../chipper/js/common/documentationToHTML' );
var fs = require( 'fs' );
const esprima = require( 'esprima' );
const jsBeautify = require( 'js-beautify' ); // eslint-disable-line require-statement-match
const extractDocumentation = require( '../chipper/js/common/extractDocumentation' );
const documentationToHTML = require( '../chipper/js/common/documentationToHTML' );
const fs = require( 'fs' );

// constants
var beautify_html = jsBeautify.html;

// use chipper's gruntfile
var Gruntfile = require( '../chipper/js/grunt/Gruntfile.js' ); // eslint-disable-line
const Gruntfile = require( '../chipper/js/grunt/Gruntfile.js' ); // eslint-disable-line

// Add repo-specific grunt tasks
module.exports = function( grunt ) {
Expand Down
8 changes: 4 additions & 4 deletions js/BinPacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
* @author Sharfudeen Ashraf
* @author Jonathan Olson <[email protected]>
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var Bounds2 = require( 'DOT/Bounds2' );
var dot = require( 'DOT/dot' );
var inherit = require( 'PHET_CORE/inherit' );
const Bounds2 = require( 'DOT/Bounds2' );
const dot = require( 'DOT/dot' );
const inherit = require( 'PHET_CORE/inherit' );

/**
* Creates a BinPacker with the specified containing bounds.
Expand Down
6 changes: 3 additions & 3 deletions js/BinPackerTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var BinPacker = require( 'DOT/BinPacker' );
var Bounds2 = require( 'DOT/Bounds2' );
const BinPacker = require( 'DOT/BinPacker' );
const Bounds2 = require( 'DOT/Bounds2' );

QUnit.module( 'BinPacker' );

Expand Down
10 changes: 5 additions & 5 deletions js/Bounds2.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
var inherit = require( 'PHET_CORE/inherit' );
var Poolable = require( 'PHET_CORE/Poolable' );
var Vector2 = require( 'DOT/Vector2' );
const dot = require( 'DOT/dot' );
const inherit = require( 'PHET_CORE/inherit' );
const Poolable = require( 'PHET_CORE/Poolable' );
const Vector2 = require( 'DOT/Vector2' );

// Temporary instances to be used in the transform method.
var scratchVector2 = new dot.Vector2( 0, 0 );
Expand Down
10 changes: 5 additions & 5 deletions js/Bounds2IO.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* @author Sam Reid (PhET Interactive Simulations)
* @author Andrew Adare (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var Bounds2 = require( 'DOT/Bounds2' );
var dot = require( 'DOT/dot' );
var ObjectIO = require( 'TANDEM/types/ObjectIO' );
var validate = require( 'AXON/validate' );
const Bounds2 = require( 'DOT/Bounds2' );
const dot = require( 'DOT/dot' );
const ObjectIO = require( 'TANDEM/types/ObjectIO' );
const validate = require( 'AXON/validate' );

class Bounds2IO extends ObjectIO {

Expand Down
10 changes: 5 additions & 5 deletions js/Bounds2Tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* @author Jonathan Olson (PhET Interactive Simulations)
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var Bounds2 = require( 'DOT/Bounds2' );
var Matrix3 = require( 'DOT/Matrix3' );
var Rectangle = require( 'DOT/Rectangle' );
var Vector2 = require( 'DOT/Vector2' );
const Bounds2 = require( 'DOT/Bounds2' );
const Matrix3 = require( 'DOT/Matrix3' );
const Rectangle = require( 'DOT/Rectangle' );
const Vector2 = require( 'DOT/Vector2' );

QUnit.module( 'Bounds2' );

Expand Down
8 changes: 4 additions & 4 deletions js/Bounds3.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
var inherit = require( 'PHET_CORE/inherit' );
var Poolable = require( 'PHET_CORE/Poolable' );
const dot = require( 'DOT/dot' );
const inherit = require( 'PHET_CORE/inherit' );
const Poolable = require( 'PHET_CORE/Poolable' );

require( 'DOT/Vector3' );

Expand Down
10 changes: 5 additions & 5 deletions js/Bounds3IO.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* @author Sam Reid (PhET Interactive Simulations)
* @author Andrew Adare (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var Bounds3 = require( 'DOT/Bounds3' );
var dot = require( 'DOT/dot' );
var ObjectIO = require( 'TANDEM/types/ObjectIO' );
var validate = require( 'AXON/validate' );
const Bounds3 = require( 'DOT/Bounds3' );
const dot = require( 'DOT/dot' );
const ObjectIO = require( 'TANDEM/types/ObjectIO' );
const validate = require( 'AXON/validate' );

class Bounds3IO extends ObjectIO {

Expand Down
6 changes: 3 additions & 3 deletions js/Complex.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* @author Matt Pennington
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
const dot = require( 'DOT/dot' );
require( 'DOT/Util' );
var inherit = require( 'PHET_CORE/inherit' );
const inherit = require( 'PHET_CORE/inherit' );

/**
* Creates a complex number, that has both a real and imaginary part.
Expand Down
4 changes: 2 additions & 2 deletions js/ComplexTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* @author Jonathan Olson (PhET Interactive Simulations)
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var Complex = require( 'DOT/Complex' );
const Complex = require( 'DOT/Complex' );

QUnit.module( 'Complex' );

Expand Down
4 changes: 2 additions & 2 deletions js/ConvexHull2.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
const dot = require( 'DOT/dot' );

/**
* counter-clockwise turn if > 0, clockwise turn if < 0, collinear if === 0.
Expand Down
6 changes: 3 additions & 3 deletions js/DampedHarmonic.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
var inherit = require( 'PHET_CORE/inherit' );
const dot = require( 'DOT/dot' );
const inherit = require( 'PHET_CORE/inherit' );

/**
* For solving ax'' + bx' + cx = 0 with initial conditions x(0) and x'(0).
Expand Down
4 changes: 2 additions & 2 deletions js/DampedHarmonicTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* @author Jonathan Olson (PhET Interactive Simulations)
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var DampedHarmonic = require( 'DOT/DampedHarmonic' );
const DampedHarmonic = require( 'DOT/DampedHarmonic' );

QUnit.module( 'DampedHarmonic' );

Expand Down
14 changes: 7 additions & 7 deletions js/DelaunayTriangulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
*
* @author Jonathan Olson <[email protected]>
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var arrayRemove = require( 'PHET_CORE/arrayRemove' );
var Bounds2 = require( 'DOT/Bounds2' );
var dot = require( 'DOT/dot' );
var inherit = require( 'PHET_CORE/inherit' );
var Util = require( 'DOT/Util' );
var Vector2 = require( 'DOT/Vector2' );
const arrayRemove = require( 'PHET_CORE/arrayRemove' );
const Bounds2 = require( 'DOT/Bounds2' );
const dot = require( 'DOT/dot' );
const inherit = require( 'PHET_CORE/inherit' );
const Util = require( 'DOT/Util' );
const Vector2 = require( 'DOT/Vector2' );

/**
* @public
Expand Down
6 changes: 3 additions & 3 deletions js/Dimension2.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
var inherit = require( 'PHET_CORE/inherit' );
const dot = require( 'DOT/dot' );
const inherit = require( 'PHET_CORE/inherit' );
require( 'DOT/Bounds2' );

/**
Expand Down
4 changes: 2 additions & 2 deletions js/EigenvalueDecomposition.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
const dot = require( 'DOT/dot' );

var ArrayType = window.Float64Array || Array;

Expand Down
4 changes: 2 additions & 2 deletions js/LUDecomposition.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
const dot = require( 'DOT/dot' );

var ArrayType = window.Float64Array || Array;

Expand Down
4 changes: 2 additions & 2 deletions js/LinearFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
*
* @author Chris Malley (PixelZoom, Inc.)
*/
define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
const dot = require( 'DOT/dot' );

// modules
require( 'DOT/Util' );
Expand Down
4 changes: 2 additions & 2 deletions js/LinearFunctionTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* @author Jonathan Olson (PhET Interactive Simulations)
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var LinearFunction = require( 'DOT/LinearFunction' );
const LinearFunction = require( 'DOT/LinearFunction' );

QUnit.module( 'LinearFunction' );

Expand Down
6 changes: 3 additions & 3 deletions js/Matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
const dot = require( 'DOT/dot' );

var ArrayType = window.Float64Array || Array;

var isArray = require( 'PHET_CORE/isArray' );
const isArray = require( 'PHET_CORE/isArray' );

require( 'DOT/SingularValueDecomposition' );
require( 'DOT/LUDecomposition' );
Expand Down
6 changes: 3 additions & 3 deletions js/Matrix3.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
var Poolable = require( 'PHET_CORE/Poolable' );
const dot = require( 'DOT/dot' );
const Poolable = require( 'PHET_CORE/Poolable' );

require( 'DOT/Vector2' );
require( 'DOT/Vector3' );
Expand Down
6 changes: 3 additions & 3 deletions js/Matrix3Tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* @author Jonathan Olson (PhET Interactive Simulations)
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var Matrix3 = require( 'DOT/Matrix3' );
var Vector2 = require( 'DOT/Vector2' );
const Matrix3 = require( 'DOT/Matrix3' );
const Vector2 = require( 'DOT/Vector2' );

QUnit.module( 'Matrix3' );

Expand Down
4 changes: 2 additions & 2 deletions js/Matrix4.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
const dot = require( 'DOT/dot' );

require( 'DOT/Vector3' );
require( 'DOT/Vector4' );
Expand Down
4 changes: 2 additions & 2 deletions js/MatrixOps3.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* @author Jonathan Olson <[email protected]>
*/

define( function( require ) {
define( require => {
'use strict';

var dot = require( 'DOT/dot' );
const dot = require( 'DOT/dot' );

/*
* Matrices are stored as flat typed arrays with row-major indices. For example, for a 3x3:
Expand Down
Loading

0 comments on commit 97f2f4c

Please sign in to comment.