asm-js / validator

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

Error in spec, section 6.7, function calls? #81

Closed mnieper closed 10 years ago

mnieper commented 10 years ago

In 6.7 Function Calls, the spec says that a CallExpression node is:

f:Identifier(arg:Expression, ...)

Doesn't arg have to be an AssignmentExpression here?

sunfishcode commented 10 years ago

It is a little confusing, but the asm.js spec is not actually a grammar. The grammar is the JS language itself. The asm.js spec is just describing a type system on top of that language.

That said, I believe there are some opportunities to clarify the wording here. Another example is 6.6.5, which says "An AssignmentExpression node x:Identifier = expr:AssignmentExpression [...]", making it unclear whether AssignmentExpression just means the rhs, or the whole expression.