Closed
Bug 444783
Opened 17 years ago
Closed 6 years ago
Can we get the Token.name to return Token name OOTB?
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
RESOLVED
INACTIVE
People
(Reporter: gboysko, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15 eMusic DLM/4.0_1.0.0.1
Build Identifier: 1.7R1
We have several Rhino-based JavaScript tools that we are developing in-house. These are all parser-only tools--no Java bytecode is ever generated for the JavaScript.
As such, we attempt to recognize common JavaScript structures based on the structure of the Token ASTs. When we encounter a tree that we don't expect, we often generate a diagnostic message along with the unexpected Token type.
In the past, we have simply generated messages with the integer Token type.
While we use all of the Token constants for our code, when we dump out diagnostics, we only have the token integer. It would be helpful if we could also dump out the Token string (via Token.name).
However, since printTrees is a final static (false), we have to build a special version of js.jar just to change this value (and dump out Token strings).
Is there a way to get the String representations of Tokens without building a special version of js.jar?
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1•6 years ago
|
||
Closing. Bug management is now done here:
https://github.com/mozilla/rhino
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
You need to log in
before you can comment on or make changes to this bug.
Description
•