Parser won't parse typeof against expressions #25

Open
caseyhoward opened this Issue Apr 14, 2010 · 1 comment

Projects

None yet

2 participants

@caseyhoward

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.

Collaborator

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;")

@smparkes smparkes was assigned Apr 13, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment