Rendering of template text makes a bad decision
Starting with (this admittedly bad fake of an OL element in JS):
/*jshint esversion:6 */
(function (global) {
"use strict";
class OrderedList {
constructor (id) {
this._id = id;
this._items = [];
this._handle = null;
this._parent = null;
}
item (itemText)
{
this._items.push(itemText);
return this;
}
appendTo (parent)
{
this._parent = parent;
this._handle = document.createElement("OL");
return this;
}
render () {
let res = `<ol id="${this._id}">`,
mx = this._items.length;
for (let i = 0; i < mx; ++i) {
res += `<li>${this._items[i]}</li>`;
}
res += `</ol>`;
if (this._parent && this._handle) {
}
return this;
}
}
}(window));
One finds that the interior of the loop in render() comes out as
res += "<li>" + (this$1._items[i]) + "</li>";
so I'm guessing a Regex replace didn't work quite right. Pulling out the array reference as
const e = this._items[i];
and then using e
gives an expected result.