r102023 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102022‎ | r102023 | r102024 >
Date:18:33, 4 November 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Using getElementType instead of relying on .type property of es.DocumentModeNode objects
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js
@@ -1033,14 +1033,10 @@
10341034 // casing merging a listitem into a paragraph.
10351035
10361036 // wait, some nodes don't have types? Is this the top document node?
1037 - return (
1038 - (
1039 - ( node1 && node2 ) &&
1040 - ( node1.type !== undefined && node2.type !== undefined ) &&
1041 - ( node1.type === node2.type )
1042 - ) &&
1043 - ( node1.getParent() === node2.getParent() )
1044 - );
 1037+ return (
 1038+ ( ( node1 && node2 ) && ( node1.getElementType() === node2.getElementType() ) ) &&
 1039+ ( node1.getParent() === node2.getParent() )
 1040+ );
10451041 }
10461042
10471043 function mergeDelete( range, tx ) {

Status & tagging log