diff --git a/tests/wpt/web-platform-tests/resources/webidl2/lib/webidl2.js b/tests/wpt/web-platform-tests/resources/webidl2/lib/webidl2.js index 2f116c40d94..0c9a1faacf7 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/lib/webidl2.js +++ b/tests/wpt/web-platform-tests/resources/webidl2/lib/webidl2.js @@ -14,7 +14,8 @@ const types = ["float", "integer", "identifier", "string", "whitespace", "other"]; while (str.length > 0) { let matched = false; - for (const type of types) { + for (var i in types) { + const type = types[i]; str = str.replace(re[type], tok => { tokens.push({ type, value: tok }); matched = true; @@ -119,10 +120,11 @@ "multiline-comment": /^\/\*((?:.|\n|\r)*?)\*\// }; const wsTypes = []; - for (const k in re) wsTypes.push(k); + for (var k in re) wsTypes.push(k); while (w.length) { let matched = false; - for (const type of wsTypes) { + for (var i in wsTypes) { + const type = wsTypes[i]; w = w.replace(re[type], (tok, m1) => { store.push({ type: type + (pea ? ("-" + pea) : ""), value: m1 }); matched = true;