Open
Description
Hi there,
a student of our class just found this bug.
Take a non-valid JSON file (closing square bracket missing):
[
{
"id": 1,
"level": 0,
"centroid": 0,
"bass": 0,
"lowMid": 0,
"mid": 0,
"highMid": 0
},
{
"id": 2,
"level": 0,
"centroid": 941.1855468750001,
"bass": 0,
"lowMid": 0,
"mid": 1.6990291262135921,
"highMid": 0
}
and try to decode it with basil.js:
//@includepath "~/Documents/;%USERPROFILE%Documents";
//@include "basiljs/basil.js";
function draw() {
b.clear(b.doc());
//JSON
var jsonString = b.loadString("buggy.json");
var jsonData = b.JSON.decode( jsonString );
b.println("Hello world!"); // --> does not print
b.rect(0, 0, 100, 100); // --> does not draw
}
b.go();
basil does not throw any error but instead silently stops executing any commands after the b.JSON.decode()
.