asm-js / validator

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

No global support in validator. #42

Open ScatteredRay opened 11 years ago

ScatteredRay commented 11 years ago

The code:

function mymodule(global, foreign, buffer) {
    "use asm";
    var g_i = 0; 
    return { g_export: g_i };
}

fails to validate with the error: expected import binding or heap view declaration, got Literal node This seems to be simply due to not checking this, and depending on location either tries to verify it as an import, or an export.