Open socketpair opened 8 years ago
Not sure what you mean. If I paste this code:
function helloWorld(stdlib, foreign, heap) {
"use asm";
var HEAP64 = new stdlib.Float64Array(heap);
// this is what we're validating
function giveThemTheAnswer() {
var x += 2;
var y = 40;
return (x|0 + y|0)|0;
}
return { answer: giveThemTheAnswer };
}
Into the editor I get correct error next to x += 2
. Please provide more info.
Please check WHICH error you see. In your example. x
is undefined, and more over, var x += 2
is wrong JS code. Try this:
function helloWorld(stdlib, foreign, heap) {
"use asm";
var HEAP64 = new stdlib.Float64Array(heap);
// this is what we're validating
function giveThemTheAnswer() {
var x = 2;
var y = 40;
y += 5;
return (x|0 + y|0)|0;
}
return { answer: giveThemTheAnswer };
}
However, I use VERY unfriendly http://turtlescript.github.cscott.net/asmjs.html , but it works!
Ah, I see what you mean now. The bug comes from upstream asm.js parser. Logged it there: https://github.com/dherman/asm.js/issues/118
Thanks for letting us know!
Please re-read .spec and implement everything written