asm-js / validator

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

`if` fails the validator: `types` does not exist #86

Closed amadanmath closed 9 years ago

amadanmath commented 10 years ago

If the code includes an if, the validator errors out, due to this line in Vp.ifStatement:

this.checkSubtype(this.expression(test), types.boolish, "if test", test.loc);

The variable types does not exist. I believe one wants ty instead; and ty does not contain boolish nor Boolish. It was probably missed in 182e4b9efe556f205e33be1f9357938a41ebbbe3 and should be ty.Intish?

soliton4 commented 9 years ago

@amadanmath fixed it:

https://github.com/dherman/asm.js/pull/96

sunfishcode commented 9 years ago

The fix is merged.