Add Tour.newt sample and make it the default.

Improvements to editor support.
This commit is contained in:
2024-11-07 21:05:05 -08:00
parent 24ab6aa212
commit f0c9e3bf63
8 changed files with 281 additions and 51 deletions

View File

@@ -130,6 +130,7 @@ onmessage = function (e) {
files[fn] = src;
files['out.js'] = 'No JS output';
stdout = ''
const start = +new Date()
try {
newtMain();
} catch (e) {
@@ -138,7 +139,9 @@ onmessage = function (e) {
// make it visable
stdout += '\n' + String(e)
}
let duration = +new Date() - start
console.log(`process ${fn} in ${duration} ms`)
let javascript = files['out.js']
let output = stdout
postMessage({javascript, output})
postMessage({javascript, output, duration})
}