Modernize ES for-loops and remove problematic for-in loops
This slightly modifies the behaviour of errors (see init.js)
Change-Id: I1aab691d5b7e8167b6213378bdd9139c133202cd
diff --git a/dev/js/src/match/table.js b/dev/js/src/match/table.js
index 3ad2731..9078780 100644
--- a/dev/js/src/match/table.js
+++ b/dev/js/src/match/table.js
@@ -104,8 +104,7 @@
_parse : function (children, mark) {
// Get all children
- for (var i in children) {
- var c = children[i];
+ children.forEach(function(c) {
// Create object on position unless it exists
if (this._info[this._pos] === undefined) {
@@ -180,7 +179,7 @@
this._token[this._pos++] = c.nodeValue;
};
};
- };
+ }, this);
delete this._info[this._pos];
},
@@ -250,7 +249,7 @@
tr.addCell('th', undefined, 'Layer');
// Add tokens
- for (var i in this._token) {
+ Object.keys(this._token).forEach(function(i) {
let surface = this.getToken(i);
var c = tr.addCell('th', undefined, surface);
if (this._mark[i]) {
@@ -267,7 +266,7 @@
if (surface.length > 20) {
c.setAttribute("title", surface)
}
- };
+ }, this);
var tbody = table.addE('tbody');