pxt-calliope/tdworker.js
Matthias L. Jugel b028b1df5b Auto-push
2017-08-19 17:16:35 +02:00

30 lines
535 B
JavaScript

var window = self;
window.localStorage = {}
function require() { return null }
importScripts(
"/pxt-calliope/tdast.js"
)
onmessage = function(ev) {
var data = ev.data
if (data.op == "td2ts") {
var r = TDev.AST.td2ts(data.arg)
postMessage({
id: data.id,
op: data.op,
result: r
})
} else {
postMessage({
id: data.id,
op: data.op,
error: "Command not understood"
})
}
}
postMessage({
id: "ready"
})