Skip to content

XmlMemberGet toSource() implementation #483

@kuzjka

Description

@kuzjka

Rhino has support for E4X extensions, such as attribute get operator a.@b. It is parsed correctly as XmlMemberGet node, but toSource() call causes IllegalArgumentException, thrown from AstNode.operatorToString(), which is given '.' or '..' token.

Following snippet resembles this issue (default CompilerEnvirons is used):

String script = "a.@b;";
Parser parser = new Parser(environment);
AstRoot root = parser.parse(script, null, 1);
/* up to 1.7.9 following will throw IllegalArgumentException */
root.toSource();

I have prepared a pull request, it will be opened right after this issue is created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions