-
-
Notifications
You must be signed in to change notification settings - Fork 258
Incorrect "keyword" value for the key of object property which looks like an boolean #18
Comments
This is probably true for other keywords as object keys like say |
yeah |
It is a keyword though, right? It's just that in this instance, a keyword is allowed as a name, it doesn't make the token less of a keyword token. |
Keyword token plays role of a keyword. In this case it's just an identifier. |
I'd say it is a matter of interpretation - like in ast it is definitely an identifier, whereas in tokens list it is could be interpreted as keyword (and might be useful in some situations), although, tokens are needed to do an ast and it is pretty hard to distinguish it from other entities, since those and this token are identical, so we would need to analyze the surroundings and stuff. On the other hand other tokenizers consider this a keyword. I think everybody would win if we would add a clarifier - another flag, property. As a bonus no one would consider this a breaking change, if that sounds acceptable we can provide a pr btw. Also, on the side note - i think for the case like ({ "something": 1 })
|
This issue has been moved to babel/babel#6724. |
For the case like
token for the key, will look like this -
I believe
"keyword": "true"
bit should look like this -"keyword": undefined
or"keyword": false
The text was updated successfully, but these errors were encountered: