Closed Bug 306268 Opened 19 years ago Closed 19 years ago

Decompilation of E4X dot query is broken

Categories

(Rhino Graveyard :: E4X, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

Details

Attachments

(1 file)

Patches from Olinda Spider (pat@mcnerthney.com):

Here is another patch that fixes the displayed, decompiled output of
the E4X dot query operator.  It was missing the terminating right
parathesis.

--- rhino1_6R2pre-org/src/org/mozilla/javascript/Parser.java
+++ rhino1_6R2pre-new/src/org/mozilla/javascript/Parser.java
@@ -1702,6 +1702,7 @@
                 decompiler.addToken(Token.DOTQUERY);
                 pn = nf.createDotQuery(pn, expr(false),
ts.getLineno());
                 mustMatchToken(Token.RP, "msg.no.paren");
+                decompiler.addToken(Token.RP);
                 break;

               case Token.LB: 


Here is another patch that fixes the displayed, decompiled output of
the E4X dot query operator.  It was missing the terminating right
parathesis.

--- rhino1_6R2pre-org/src/org/mozilla/javascript/Parser.java
+++ rhino1_6R2pre-new/src/org/mozilla/javascript/Parser.java
@@ -1702,6 +1702,7 @@
                 decompiler.addToken(Token.DOTQUERY);
                 pn = nf.createDotQuery(pn, expr(false),
ts.getLineno());
                 mustMatchToken(Token.RP, "msg.no.paren");
+                decompiler.addToken(Token.RP);
                 break;

               case Token.LB:
(In reply to comment #0)
> Patches from Olinda Spider (pat@mcnerthney.com):

Wrong cut and paste, the fkirst patch was:

--- rhino1_6R2pre-org/src/org/mozilla/javascript/Decompiler.java
+++ rhino1_6R2pre-new/src/org/mozilla/javascript/Decompiler.java
@@ -783,6 +783,10 @@
                result.append("..");
                break;

+            case Token.DOTQUERY:
+                result.append(".(");
+                break;
+
            case Token.XMLATTR:
                result.append('@');
                break;
Attached patch Cumulative patch β€” β€” Splinter Review
I committed the fix
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: