diff --git a/lib/espruinotools.js b/lib/espruinotools.js index f70dfd5..d70f3cc 100644 --- a/lib/espruinotools.js +++ b/lib/espruinotools.js @@ -1,6 +1,6 @@ // EspruinoTools bundle (https://github.com/espruino/EspruinoTools) -// Created with https://github.com/espruino/EspruinoWebIDE/blob/gh-pages/extras/create_espruinotools_js.sh -// Based on EspruinoWebIDE 0.78.14 +// Created with https://github.com/espruino/EspruinoWebIDE/blob/master/extras/create_espruinotools_js.sh +// Based on EspruinoWebIDE 0.78.15 /** Copyright 2014 Gordon Williams (gw@pur3.co.uk) @@ -4674,7 +4674,7 @@ while (d!==undefined) {console.log(btoa(d));d=f.read(${CHUNKSIZE});} fileLoader.click(); } - /* Save a file with a save file dialog. callback(savedFileName) only called in chrome app case when we knopw the filename*/ + /* Save a file with a save file dialog (data=String). callback(savedFileName) only called in chrome app case when we know the filename*/ function fileSaveDialog(data, filename, callback) { function errorHandler() { Espruino.Core.Notifications.error("Error Saving", true); @@ -33711,7 +33711,9 @@ global.esmangle = require('../lib/esmangle'); resultCode = resultCode.substring(0, resultCode.length-5); // remove 'atob(' } let length = str.length; - if (length<256) + if (length==0) { // it's shorter just to write quotes + resultCode += ""; + } else if (length<256) resultCode += String.fromCharCode(LEX_RAW_STRING8, length) + str; else if (length<65536) resultCode += String.fromCharCode(LEX_RAW_STRING16, length&255, (length>>8)&255)+str;