Skip to content

Commit

Permalink
pass bounds options to mutate at end of constructor, provide options …
Browse files Browse the repository at this point in the history
…arg index to all mixins (and assert), remove unneeded mutate calls next to super, #1340
  • Loading branch information
zepumph committed Feb 8, 2022
1 parent 57e524f commit 58497e2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions js/accessibility/voicing/InteractiveHighlighting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type InteractiveHighlightingOptions = InteractiveHighlightingSelfOptions & NodeO
* @param optionsArgPosition - zero-indexed number that the options argument is provided at
*/
const InteractiveHighlighting = <SuperType extends Constructor>( Type: SuperType, optionsArgPosition: number ) => {
assert && assert( typeof optionsArgPosition === 'number', 'Must provide an index to access options arg from (zero-indexed)' );
assert && assert( _.includes( inheritance( Type ), Node ), 'Only Node subtypes should compose InteractiveHighlighting' );

const InteractiveHighlightingClass = class extends Type {
Expand Down
2 changes: 1 addition & 1 deletion js/accessibility/voicing/ReadingBlockNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import merge from '../../../../phet-core/js/merge.js';
import { scenery, Node, ReadingBlock, ReadingBlockHighlight } from '../../imports.js';

class ReadingBlockNode extends ReadingBlock( Node ) {
class ReadingBlockNode extends ReadingBlock( Node, 0 ) {

/**
* @param {Object} [options]
Expand Down
2 changes: 1 addition & 1 deletion js/accessibility/voicing/nodes/VoicingRichText.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import merge from '../../../../../phet-core/js/merge.js';
import { ReadingBlock, ReadingBlockHighlight, RichText, scenery } from '../../../imports.js';

class VoicingRichText extends ReadingBlock( RichText ) {
class VoicingRichText extends ReadingBlock( RichText, 1 ) {

/**
* @param {string} text
Expand Down
2 changes: 1 addition & 1 deletion js/accessibility/voicing/nodes/VoicingText.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import merge from '../../../../../phet-core/js/merge.js';
import { ReadingBlock, ReadingBlockHighlight, scenery, Text } from '../../../imports.js';

class VoicingText extends ReadingBlock( Text ) {
class VoicingText extends ReadingBlock( Text, 1 ) {

/**
* @param {string} text
Expand Down

0 comments on commit 58497e2

Please sign in to comment.