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 34e7bdb commit 45d2222
Show file tree
Hide file tree
Showing 26 changed files with 196 additions and 196 deletions.
10 changes: 5 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2013-2016, University of Colorado Boulder

var pegjs = require( 'pegjs' );
var fs = require( 'fs' );
const pegjs = require( 'pegjs' );
const fs = require( 'fs' );

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

// Add repo-specific grunt tasks
module.exports = function( grunt ) {
Expand All @@ -22,8 +22,8 @@ module.exports = function( grunt ) {
' * See svgPath.pegjs for more documentation, or run \'grunt generate-svgPath-parser\' to regenerate.\n' +
' *' + '/\n' +
'\n' +
'define( function( require ) {\n' +
' var kite = require( \'KITE/kite\' );\n';
'define( require => {\n' +
' const kite = require( \'KITE/kite\' );\n';
var suffix = ' kite.register( \'svgPath\', result );\n' +
' return kite.svgPath;\n' +
'} );\n';
Expand Down
34 changes: 17 additions & 17 deletions js/Shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@
* @author Jonathan Olson <[email protected]>
*/

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

var Arc = require( 'KITE/segments/Arc' );
var Bounds2 = require( 'DOT/Bounds2' );
var Cubic = require( 'KITE/segments/Cubic' );
var EllipticalArc = require( 'KITE/segments/EllipticalArc' );
var Graph = require( 'KITE/ops/Graph' );
var inherit = require( 'PHET_CORE/inherit' );
var kite = require( 'KITE/kite' );
var Line = require( 'KITE/segments/Line' );
var LineStyles = require( 'KITE/util/LineStyles' );
var Quadratic = require( 'KITE/segments/Quadratic' );
var Ray2 = require( 'DOT/Ray2' );
var Subpath = require( 'KITE/util/Subpath' );
var svgPath = require( 'KITE/parser/svgPath' );
var TinyEmitter = require( 'AXON/TinyEmitter' );
var Util = require( 'DOT/Util' );
var Vector2 = require( 'DOT/Vector2' );
const Arc = require( 'KITE/segments/Arc' );
const Bounds2 = require( 'DOT/Bounds2' );
const Cubic = require( 'KITE/segments/Cubic' );
const EllipticalArc = require( 'KITE/segments/EllipticalArc' );
const Graph = require( 'KITE/ops/Graph' );
const inherit = require( 'PHET_CORE/inherit' );
const kite = require( 'KITE/kite' );
const Line = require( 'KITE/segments/Line' );
const LineStyles = require( 'KITE/util/LineStyles' );
const Quadratic = require( 'KITE/segments/Quadratic' );
const Ray2 = require( 'DOT/Ray2' );
const Subpath = require( 'KITE/util/Subpath' );
const svgPath = require( 'KITE/parser/svgPath' );
const TinyEmitter = require( 'AXON/TinyEmitter' );
const Util = require( 'DOT/Util' );
const Vector2 = require( 'DOT/Vector2' );

const randomSource = Math.random; // eslint-disable-line bad-sim-text (We can't get joist's random reference here)

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

// modules
var Arc = require( 'KITE/segments/Arc' );
var Bounds2 = require( 'DOT/Bounds2' );
var Cubic = require( 'KITE/segments/Cubic' );
var Line = require( 'KITE/segments/Line' );
var Matrix3 = require( 'DOT/Matrix3' );
var Quadratic = require( 'KITE/segments/Quadratic' );
var Ray2 = require( 'DOT/Ray2' );
var Shape = require( 'KITE/Shape' );
var Vector2 = require( 'DOT/Vector2' );
const Arc = require( 'KITE/segments/Arc' );
const Bounds2 = require( 'DOT/Bounds2' );
const Cubic = require( 'KITE/segments/Cubic' );
const Line = require( 'KITE/segments/Line' );
const Matrix3 = require( 'DOT/Matrix3' );
const Quadratic = require( 'KITE/segments/Quadratic' );
const Ray2 = require( 'DOT/Ray2' );
const Shape = require( 'KITE/Shape' );
const Vector2 = require( 'DOT/Vector2' );

QUnit.module( 'Shape' );

Expand Down
2 changes: 1 addition & 1 deletion js/kite-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
if ( !window.hasOwnProperty( '_' ) ) {
throw new Error( 'Underscore/Lodash not found: _' );
}
define( function( require ) {
define( require => {

window.axon = require( 'AXON/main' );
window.dot = require( 'DOT/main' );
Expand Down
2 changes: 1 addition & 1 deletion js/kite-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

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

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

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

var kite = new Namespace( 'kite' );

Expand Down
18 changes: 9 additions & 9 deletions js/ops/Boundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
* @author Jonathan Olson <[email protected]>
*/

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

var Bounds2 = require( 'DOT/Bounds2' );
var cleanArray = require( 'PHET_CORE/cleanArray' );
var inherit = require( 'PHET_CORE/inherit' );
var kite = require( 'KITE/kite' );
var Poolable = require( 'PHET_CORE/Poolable' );
var Ray2 = require( 'DOT/Ray2' );
var Subpath = require( 'KITE/util/Subpath' );
var Vector2 = require( 'DOT/Vector2' );
const Bounds2 = require( 'DOT/Bounds2' );
const cleanArray = require( 'PHET_CORE/cleanArray' );
const inherit = require( 'PHET_CORE/inherit' );
const kite = require( 'KITE/kite' );
const Poolable = require( 'PHET_CORE/Poolable' );
const Ray2 = require( 'DOT/Ray2' );
const Subpath = require( 'KITE/util/Subpath' );
const Vector2 = require( 'DOT/Vector2' );

var globaId = 0;

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

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

var inherit = require( 'PHET_CORE/inherit' );
var kite = require( 'KITE/kite' );
var Poolable = require( 'PHET_CORE/Poolable' );
var SegmentIntersection = require( 'KITE/util/SegmentIntersection' );
var Vector2 = require( 'DOT/Vector2' );
const inherit = require( 'PHET_CORE/inherit' );
const kite = require( 'KITE/kite' );
const Poolable = require( 'PHET_CORE/Poolable' );
const SegmentIntersection = require( 'KITE/util/SegmentIntersection' );
const Vector2 = require( 'DOT/Vector2' );

/**
* @public (kite-internal)
Expand Down
16 changes: 8 additions & 8 deletions js/ops/Edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
* @author Jonathan Olson <[email protected]>
*/

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

var HalfEdge = require( 'KITE/ops/HalfEdge' );
var inherit = require( 'PHET_CORE/inherit' );
var kite = require( 'KITE/kite' );
var Line = require( 'KITE/segments/Line' );
var Poolable = require( 'PHET_CORE/Poolable' );
var Segment = require( 'KITE/segments/Segment' );
var Vertex = require( 'KITE/ops/Vertex' );
const HalfEdge = require( 'KITE/ops/HalfEdge' );
const inherit = require( 'PHET_CORE/inherit' );
const kite = require( 'KITE/kite' );
const Line = require( 'KITE/segments/Line' );
const Poolable = require( 'PHET_CORE/Poolable' );
const Segment = require( 'KITE/segments/Segment' );
const Vertex = require( 'KITE/ops/Vertex' );

var globaId = 0;

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

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

var cleanArray = require( 'PHET_CORE/cleanArray' );
var inherit = require( 'PHET_CORE/inherit' );
var kite = require( 'KITE/kite' );
var Poolable = require( 'PHET_CORE/Poolable' );
const cleanArray = require( 'PHET_CORE/cleanArray' );
const inherit = require( 'PHET_CORE/inherit' );
const kite = require( 'KITE/kite' );
const Poolable = require( 'PHET_CORE/Poolable' );

var globaId = 0;

Expand Down
40 changes: 20 additions & 20 deletions js/ops/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@
* @author Jonathan Olson <[email protected]>
*/

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

var Arc = require( 'KITE/segments/Arc' );
var arrayRemove = require( 'PHET_CORE/arrayRemove' );
var Boundary = require( 'KITE/ops/Boundary' );
var cleanArray = require( 'PHET_CORE/cleanArray' );
var Cubic = require( 'KITE/segments/Cubic' );
var Edge = require( 'KITE/ops/Edge' );
var EllipticalArc = require( 'KITE/segments/EllipticalArc' );
var Face = require( 'KITE/ops/Face' );
var inherit = require( 'PHET_CORE/inherit' );
var kite = require( 'KITE/kite' );
var Line = require( 'KITE/segments/Line' );
var Loop = require( 'KITE/ops/Loop' );
var Matrix3 = require( 'DOT/Matrix3' );
var Quadratic = require( 'KITE/segments/Quadratic' );
var Segment = require( 'KITE/segments/Segment' );
var Subpath = require( 'KITE/util/Subpath' );
var Transform3 = require( 'DOT/Transform3' );
var Util = require( 'DOT/Util' );
var Vertex = require( 'KITE/ops/Vertex' );
const Arc = require( 'KITE/segments/Arc' );
const arrayRemove = require( 'PHET_CORE/arrayRemove' );
const Boundary = require( 'KITE/ops/Boundary' );
const cleanArray = require( 'PHET_CORE/cleanArray' );
const Cubic = require( 'KITE/segments/Cubic' );
const Edge = require( 'KITE/ops/Edge' );
const EllipticalArc = require( 'KITE/segments/EllipticalArc' );
const Face = require( 'KITE/ops/Face' );
const inherit = require( 'PHET_CORE/inherit' );
const kite = require( 'KITE/kite' );
const Line = require( 'KITE/segments/Line' );
const Loop = require( 'KITE/ops/Loop' );
const Matrix3 = require( 'DOT/Matrix3' );
const Quadratic = require( 'KITE/segments/Quadratic' );
const Segment = require( 'KITE/segments/Segment' );
const Subpath = require( 'KITE/util/Subpath' );
const Transform3 = require( 'DOT/Transform3' );
const Util = require( 'DOT/Util' );
const Vertex = require( 'KITE/ops/Vertex' );

var bridgeId = 0;

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

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

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

/**
* @public (kite-internal)
Expand Down
12 changes: 6 additions & 6 deletions js/ops/Loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* @author Jonathan Olson <[email protected]>
*/

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

var cleanArray = require( 'PHET_CORE/cleanArray' );
var inherit = require( 'PHET_CORE/inherit' );
var kite = require( 'KITE/kite' );
var Poolable = require( 'PHET_CORE/Poolable' );
var Subpath = require( 'KITE/util/Subpath' );
const cleanArray = require( 'PHET_CORE/cleanArray' );
const inherit = require( 'PHET_CORE/inherit' );
const kite = require( 'KITE/kite' );
const Poolable = require( 'PHET_CORE/Poolable' );
const Subpath = require( 'KITE/util/Subpath' );

var globaId = 0;

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

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

var cleanArray = require( 'PHET_CORE/cleanArray' );
var inherit = require( 'PHET_CORE/inherit' );
var kite = require( 'KITE/kite' );
var Line = require( 'KITE/segments/Line' );
var Poolable = require( 'PHET_CORE/Poolable' );
var Vector2 = require( 'DOT/Vector2' );
const cleanArray = require( 'PHET_CORE/cleanArray' );
const inherit = require( 'PHET_CORE/inherit' );
const kite = require( 'KITE/kite' );
const Line = require( 'KITE/segments/Line' );
const Poolable = require( 'PHET_CORE/Poolable' );
const Vector2 = require( 'DOT/Vector2' );

var globaId = 0;

Expand Down
4 changes: 2 additions & 2 deletions js/parser/svgPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* See svgPath.pegjs for more documentation, or run 'grunt generate-svgPath-parser' to regenerate.
*/

define( function( require ) {
var kite = require( 'KITE/kite' );
define( require => {
const kite = require( 'KITE/kite' );

/*
* Generated by PEG.js 0.7.0.
Expand Down
22 changes: 11 additions & 11 deletions js/segments/Arc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
* @author Jonathan Olson <[email protected]>
*/

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

var Bounds2 = require( 'DOT/Bounds2' );
var inherit = require( 'PHET_CORE/inherit' );
var kite = require( 'KITE/kite' );
var Line = require( 'KITE/segments/Line' );
var Overlap = require( 'KITE/util/Overlap' );
var RayIntersection = require( 'KITE/util/RayIntersection' );
var Segment = require( 'KITE/segments/Segment' );
var SegmentIntersection = require( 'KITE/util/SegmentIntersection' );
var Util = require( 'DOT/Util' );
var Vector2 = require( 'DOT/Vector2' );
const Bounds2 = require( 'DOT/Bounds2' );
const inherit = require( 'PHET_CORE/inherit' );
const kite = require( 'KITE/kite' );
const Line = require( 'KITE/segments/Line' );
const Overlap = require( 'KITE/util/Overlap' );
const RayIntersection = require( 'KITE/util/RayIntersection' );
const Segment = require( 'KITE/segments/Segment' );
const SegmentIntersection = require( 'KITE/util/SegmentIntersection' );
const Util = require( 'DOT/Util' );
const Vector2 = require( 'DOT/Vector2' );

// TODO: See if we should use this more
var TWO_PI = Math.PI * 2;
Expand Down
Loading

0 comments on commit 45d2222

Please sign in to comment.