LiveScratchpad icon indicating copy to clipboard operation
LiveScratchpad copied to clipboard

Errors on nightly with code using ternary operators

Open jeffgca opened this issue 12 years ago • 0 comments

After a bit of hacking, livescratchpad mode becomes unresponsive. When evaluation happens I get this in the JS console:

Timestamp: 12-05-09 1:22:57 PM Error: TypeError: this["on" + aNode.type] is not a function Source File: chrome://livescratchpad/content/LiveEvaluator.jsm Line: 547

This happens when using ternary operators in statements like:

function main(n) {

var result = [];

for (var i = 0; i < 18; i++) {
    var x = '';
    i % 5 === 0 ? x = 'Buzz' : x = '';

    result.push(x);

};
console.log(JSON.stringify(result, null, '  '));

}

jeffgca avatar May 09 '12 20:05 jeffgca