Parser won't parse typeof against expressions
caseyhoward opened this issue · comments
Casey Howard commented
To reproduce:
> Johnson::Parser.parse("x = {}; typeof x.blah;")
Unknown tok_unaryop type: jsop_typeofexpr
Putting parenthesis around x.blah doesn't work either.
This works fine:
> Johnson::Parser.parse("x = {}; typeof x;")
"typeof x.blah" is legitimate and evaluates 'undefined'. Tested in firefox.
Steven Parkes commented
Confirmed. There's a token type we're not covering in the AST, typeof against an expression rather than, among other things, a variable. It's not the dot per se.
This does work (don't know if you can use it as a workaround):
Johnson::Parser.parse("x = {}; y = x.blah; typeof y;")