Skip to content

Commit

Permalink
convert {null|*} from isValidValue function to valueType: [null, *], p…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jul 19, 2019
1 parent 6037161 commit 57a0203
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions js/input/SimpleDragHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ define( function( require ) {
name: 'event',
type: VoidIO,
documentation: 'the scenery pointer Event',
validator: { isValidValue: function( value ) { return value === null || value instanceof Event; } }
validator: { valueType: [ Event, null ] }
} ] )
} );

Expand Down Expand Up @@ -186,7 +186,7 @@ define( function( require ) {
name: 'event',
type: VoidIO,
documentation: 'the scenery pointer Event',
validator: { isValidValue: function( value ) { return value === null || value instanceof Event;} }
validator: { valueType: [ Event, null ] }
} ] )
} );

Expand Down
6 changes: 3 additions & 3 deletions js/listeners/PressListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ define( function( require ) {
{
name: 'targetNode',
type: VoidIO,
validator: { isValidValue: function( v ) { return v === null || v instanceof Node; } }
validator: { valueType: [ Node, null ] }
},
{
name: 'callback',
type: VoidIO,
validator: { isValidValue: function( v ) { return v === null || typeof v === 'function'; } }
validator: { valueType: [ 'function', null ] }
}
] );

Expand All @@ -57,7 +57,7 @@ define( function( require ) {
}, {
name: 'callback',
type: VoidIO,
validator: { isValidValue: function( v ) { return v === null || typeof v === 'function'; } }
validator: { valueType: [ 'function', null ] }
} ] );

// Factor out to reduce memory footprint, see https://github.com/phetsims/tandem/issues/71
Expand Down

0 comments on commit 57a0203

Please sign in to comment.