From cb839e85c45b18509ab5bebd7ed0203967379447 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Mon, 20 Feb 2012 15:49:18 -0600 Subject: [PATCH] Pull base64.js from noVNC. Better illegal character debug output. --- include/base64.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/base64.js b/include/base64.js index 0b14332..e9b3c52 100644 --- a/include/base64.js +++ b/include/base64.js @@ -41,7 +41,6 @@ * * ***** END LICENSE BLOCK ***** */ -"use strict"; /*jslint white: false, bitwise: false, plusplus: false */ /*global console */ @@ -52,6 +51,7 @@ toBase64Table : 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+ base64Pad : '=', encode: function (data) { + "use strict"; var result = '', chrTable = Base64.toBase64Table.split(''), pad = Base64.base64Pad, @@ -95,6 +95,7 @@ toBinaryTable : [ ], decode: function (data, offset) { + "use strict"; offset = typeof(offset) !== 'undefined' ? offset : 0; var binTable = Base64.toBinaryTable, pad = Base64.base64Pad, @@ -115,7 +116,7 @@ decode: function (data, offset) { padding = (data.charAt(i) === pad); // Skip illegal characters and whitespace if (c === -1) { - console.error("Illegal character '" + data.charCodeAt(i) + "'"); + console.error("Illegal character code " + data.charCodeAt(i) + " at position " + i); continue; }