Skip to content
This repository has been archived by the owner on Aug 18, 2018. It is now read-only.

Parser won't parse typeof against expressions #25

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

Parser won't parse typeof against expressions #25

caseyhoward opened this issue Apr 14, 2010 · 1 comment
Assignees
Labels

Comments

@caseyhoward
Copy link

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.

@smparkes
Copy link
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;")

@ghost ghost assigned smparkes Apr 13, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants