microstudio
microstudio copied to clipboard
Javascript language give incorrect line number for syntax errors
The following code give the line number of the runner, not the program.
const TEST = {
broken:()=>{,
}
You can get the correct line number by running the program in a webworker like this.
let blob = new Blob([program])
let url = URL.createObjectURL(blob)
w = new Worker(url)
w.onerror = (e)=>{
this.microvm.context.location = {
token: {
line: e.lineNumber,
column: e.columnNumber
}
};
}