-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new espruintools with pretokenise fix
- Loading branch information
1 parent
2603ca6
commit c72fe1d
Showing
1 changed file
with
6 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) | ||
|
||
|
@@ -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; | ||
|