|
50 | 50 |
|
51 | 51 | var SubsetMapping = function SubsetMapping(a, b) { |
52 | 52 | this.old = a; |
53 | | - this.new = b; |
| 53 | + this['new'] = b; |
54 | 54 | }; |
55 | 55 |
|
56 | 56 | SubsetMapping.prototype = { |
57 | 57 | contains: function contains(subset) { |
58 | 58 | if (subset.length < this.length) { |
59 | | - return subset.new >= this.new && subset.new < this.new + this.length; |
| 59 | + return subset['new'] >= this['new'] && subset['new'] < this['new'] + this.length; |
60 | 60 | } |
61 | 61 | return false; |
62 | 62 | }, |
63 | 63 | toString: function toString() { |
64 | | - return this.length + " element subset, first mapping: old " + this.old + " → new " + this.new; |
| 64 | + return this.length + " element subset, first mapping: old " + this.old + " → new " + this['new']; |
65 | 65 | } |
66 | 66 | }; |
67 | 67 |
|
|
70 | 70 | if (el.nodeName !== '#text' && el.nodeName !== '#comment') { |
71 | 71 | output.push(el.nodeName); |
72 | 72 | if (el.attributes) { |
73 | | - if (el.attributes.class) { |
74 | | - output.push(el.nodeName + '.' + el.attributes.class.replace(/ /g, '.')); |
| 73 | + if (el.attributes['class']) { |
| 74 | + output.push(el.nodeName + '.' + el.attributes['class'].replace(/ /g, '.')); |
75 | 75 | } |
76 | 76 | if (el.attributes.id) { |
77 | 77 | output.push(el.nodeName + '#' + el.attributes.id); |
|
214 | 214 | return true; |
215 | 215 | } |
216 | 216 | } |
217 | | - if (e1.attributes.class && e1.attributes.class === e2.attributes.class) { |
218 | | - var classDescriptor = e1.nodeName + '.' + e1.attributes.class.replace(/ /g, '.'); |
| 217 | + if (e1.attributes['class'] && e1.attributes['class'] === e2.attributes['class']) { |
| 218 | + var classDescriptor = e1.nodeName + '.' + e1.attributes['class'].replace(/ /g, '.'); |
219 | 219 | if (classDescriptor in uniqueDescriptors) { |
220 | 220 | return true; |
221 | 221 | } |
|
354 | 354 | // give elements from the same subset the same group number |
355 | 355 | stable.forEach(function(subset) { |
356 | 356 | var i, endOld = subset.old + subset.length, |
357 | | - endNew = subset.new + subset.length; |
| 357 | + endNew = subset['new'] + subset.length; |
358 | 358 | for (i = subset.old; i < endOld; i += 1) { |
359 | 359 | gaps1[i] = group; |
360 | 360 | } |
361 | | - for (i = subset.new; i < endNew; i += 1) { |
| 361 | + for (i = subset['new']; i < endNew; i += 1) { |
362 | 362 | gaps2[i] = group; |
363 | 363 | } |
364 | 364 | group += 1; |
|
386 | 386 | }, |
387 | 387 | markBoth = function(i) { |
388 | 388 | marked1[subset.old + i] = true; |
389 | | - marked2[subset.new + i] = true; |
| 389 | + marked2[subset['new'] + i] = true; |
390 | 390 | }; |
391 | 391 |
|
392 | 392 | while (subset) { |
|
875 | 875 | } |
876 | 876 | // group relocation |
877 | 877 | group = subtrees[gaps1[index2]]; |
878 | | - toGroup = Math.min(group.new, (t1.childNodes.length - group.length)); |
| 878 | + toGroup = Math.min(group['new'], (t1.childNodes.length - group.length)); |
879 | 879 | if (toGroup !== group.old) { |
880 | 880 | // Check whether destination nodes are different than originating ones. |
881 | 881 | destinationDifferent = false; |
|
0 commit comments