@@ -240,7 +240,7 @@ export class VRange {
240240 } else if ( position === RelativePosition . AFTER ) {
241241 reference = reference . lastLeaf ( ) ;
242242 }
243- if ( reference . is ( ContainerNode ) && ! reference . hasChildren ( ) ) {
243+ if ( reference instanceof ContainerNode && ! reference . hasChildren ( ) ) {
244244 reference . prepend ( this . start ) ;
245245 } else if ( position === RelativePosition . AFTER && reference !== this . end ) {
246246 // We check that `reference` isn't `this.end` to avoid a backward
@@ -266,7 +266,7 @@ export class VRange {
266266 } else if ( position === RelativePosition . AFTER ) {
267267 reference = reference . lastLeaf ( ) ;
268268 }
269- if ( reference . is ( ContainerNode ) && ! reference . hasChildren ( ) ) {
269+ if ( reference instanceof ContainerNode && ! reference . hasChildren ( ) ) {
270270 reference . append ( this . end ) ;
271271 } else if ( position === RelativePosition . BEFORE && reference !== this . start ) {
272272 // We check that `reference` isn't `this.start` to avoid a backward
@@ -366,7 +366,7 @@ export class VRange {
366366 empty ( ) : void {
367367 const removableNodes = this . selectedNodes ( node => {
368368 // TODO: Replace Table check with complex table selection support.
369- return this . mode . is ( node , RuleProperty . EDITABLE ) && ! node . is ( TableCellNode ) ;
369+ return this . mode . is ( node , RuleProperty . EDITABLE ) && ! ( node instanceof TableCellNode ) ;
370370 } ) ;
371371 // Remove selected nodes without touching the start range's ancestors.
372372 const startAncestors = this . start . ancestors ( ) ;
0 commit comments