asm-js / validator

A reference validator for asm.js.
Apache License 2.0
1.78k stars 154 forks source link

If doesn't work? #113

Open remexre opened 8 years ago

remexre commented 8 years ago
var asm = require("../lib/asm.js");

try {
    var report = asm.validate(String(
        function f(stdlib, foreign, heap) {
            "use asm";

            var t = 0;

            function f() {
                if (t|0 == 0) {
                    t = 1;
                }
                return t|0;
            }
            return {};
        }
    ));

    console.log('validated');
} catch(e) {
    console.error(e);
}
sunfishcode commented 8 years ago

test.js:10:21 warning: asm.js type error: duplicate name 'f' not allowed

remexre commented 8 years ago

Whoops. Fixed, but I'm getting [ReferenceError: types is not defined]

sunfishcode commented 8 years ago

It appears to work for me. Can you post the exact testcase you're using, and the commands you're running?

remexre commented 8 years ago

I'm using what I posted in the original, but replacing the inner function's name with g. I'm putting it in the tests directory, and running as node test-if.js On Aug 3, 2015 11:41 AM, "Dan Gohman" notifications@github.com wrote:

It appears to work for me. Can you post the exact testcase you're using, and the commands you're running?

— Reply to this email directly or view it on GitHub https://github.com/dherman/asm.js/issues/113#issuecomment-127324787.