r94919 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94918‎ | r94919 | r94920 >
Date:18:52, 18 August 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Added data check to annotation comparison used in annotation removal operations
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Transaction.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Transaction.js
@@ -82,11 +82,20 @@
8383 }
8484 var index;
8585 for ( var i = 0; i < stack.length; i++ ) {
86 - // TODO: Compare data too: es.Content.compareObjects( stack[i], val.annotation )
87 - if ( stack[i].type === val.annotation.type ) {
88 - index = i;
89 - break;
 86+ // Type check
 87+ if ( stack[i].type !== val.annotation.type ) {
 88+ // Nope
 89+ continue;
9090 }
 91+ // Data check
 92+ if ( ( stack[i].data || stack[i].data )
 93+ && !es.Content.compareObjects( stack[i], val.annotation ) ) {
 94+ // Nope
 95+ continue;
 96+ }
 97+ // Found it!
 98+ index = i;
 99+ break;
91100 }
92101 if ( index === undefined ) {
93102 throw 'Annotation stack error. Annotation is missing.';

Status & tagging log