Skip to content

Commit

Permalink
add new espruintools with pretokenise fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Mar 25, 2024
1 parent 2603ca6 commit c72fe1d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/espruinotools.js
Original file line number Diff line number Diff line change
@@ -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 ([email protected])

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c72fe1d

Please sign in to comment.