Index: work/remote/web/client/scripts/draw.js =================================================================== --- work/remote/web/client/scripts/draw.js (revision 5609) +++ work/remote/web/client/scripts/draw.js (revision 5610) @@ -184,7 +184,7 @@ if (this.gc && this.gc.gci === gci) return; - let gc = this.GCs[gci]; + var gc = this.GCs[gci]; if (!gc) { this.comm.error("invalid GC index"); throw new Error("invalid GC index"); Index: work/remote/web/protocol/protocol.js =================================================================== --- work/remote/web/protocol/protocol.js (revision 5609) +++ work/remote/web/protocol/protocol.js (revision 5610) @@ -29,8 +29,8 @@ * @param buffer - An array-like indexable object whose elements are octets. */ ProtocolParser.prototype.parse = function (buffer) { - for (let i = 0; i < buffer.length; ++i) { - let b = buffer[i]; + for (var i = 0; i < buffer.length; ++i) { + var b = buffer[i]; switch (this.state) { case MSG: @@ -82,7 +82,7 @@ this.state = COMMENT; --i; } else { - let list = { + var list = { elements: [], type: GENERIC, parent: this.list @@ -93,7 +93,7 @@ this.list = list; } } else if (b === 123) { // '{' - let list = { + var list = { elements: [], type: BINARY, parent: this.list @@ -168,15 +168,15 @@ --i; } else if (b >= 65 && b <= 90) { // A-Z this.strLenSize++; - let code = b - 65; + var code = b - 65; this.strLen = (this.strLen << 6) + code; } else if (b >= 97 && b <= 122) { // a-z this.strLenSize++; - let code = b - 97 + 26; + var code = b - 97 + 26; this.strLen = (this.strLen << 6) + code; } else if (b >= 48 && b <= 57) { // 0-9 this.strLenSize++; - let code = b - 48 + 52; + var code = b - 48 + 52; this.strLen = (this.strLen << 6) + code; } else if (b === 43) { // '+' this.strLenSize++; @@ -240,9 +240,9 @@ * Converts the argument tree to array of arrays by removing object levels. */ ProtocolParser.compactTree = function (tree) { - let list = tree.elements; - for (let i = 0; i < list.length; ++i) { - let elem = list[i]; + var list = tree.elements; + for (var i = 0; i < list.length; ++i) { + var elem = list[i]; if (typeof elem === "object") { list[i] = ProtocolParser.compactTree(elem); } Index: work/remote/web/testclient/draw.html =================================================================== --- work/remote/web/testclient/draw.html (revision 5609) +++ work/remote/web/testclient/draw.html (revision 5610) @@ -7,6 +7,7 @@

Document drawing

+

Error loading draw-bundle.js

Index: work/remote/web/testclient/draw.js =================================================================== --- work/remote/web/testclient/draw.js (revision 5609) +++ work/remote/web/testclient/draw.js (revision 5610) @@ -1,5 +1,7 @@ "use strict" +removeElementById("loadjs"); + var protocol = require("../protocol/protocol"); var draw = require("../client/scripts/draw"); @@ -24,7 +26,7 @@ function drawBuffer(buffer, crctx) { - let ge = new draw.GraphicEngine({ + var ge = new draw.GraphicEngine({ comm: new TestComm(), canvas: crctx, colors: { @@ -33,7 +35,7 @@ } }); - let parser = new protocol.ProtocolParser(); + var parser = new protocol.ProtocolParser(); parser.onCommand = function (cmd, args) { ge.onMessage(cmd, args); }; @@ -56,3 +58,11 @@ console.log("client disconnected"); } } + + +function removeElementById(id) { + var e = document.getElementById(id); + if (e && e.parentNode) { + e.parentNode.removeChild(e); + } +}