asm-js / validator

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

Readme example tries to apply unary + to int #59

Closed cscott closed 10 years ago

cscott commented 11 years ago

The example in the readme contains:

    var g_i = 0;   // int global
    function g() {
        g_f = +g_i; // read/write globals
        return;
    }

But according to http://asmjs.org/spec/latest/, the type of g_i should be int and the type of unary + should be (signed)->double ^ (unsigned)->double ^ (doublish)->double. Since int is not a subtype of unsigned, the example fails to type check.

sunfishcode commented 10 years ago

This is fixed in 77b6caedd9f1aa8628e3d2e1a38b9eac71df95b7. Thanks!