Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Add info about not calling super in is() methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed Apr 3, 2020
1 parent 13bdf60 commit b99b7a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/model/liveposition.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export default class LivePosition extends Position {
* @returns {Boolean}
*/
is( type ) {
return type == 'livePosition' || type == 'model:livePosition' || type == 'position' || type == 'model:position';
return type == 'livePosition' || type == 'model:livePosition' ||
// From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
type == 'position' || type == 'model:position';
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/model/liverange.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export default class LiveRange extends Range {
* @returns {Boolean}
*/
is( type ) {
return type == 'liveRange' || type == 'model:liveRange' || type == 'range' || type == 'model:range';
return type == 'liveRange' || type == 'model:liveRange' ||
// From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
type == 'range' || type == 'model:range';
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/model/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default class Text extends Node {
*/
is( type ) {
return type === 'text' || type === 'model:text' ||
// From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
type === 'node' || type === 'model:node';
}

Expand Down

0 comments on commit b99b7a0

Please sign in to comment.