Skip to content

Invalid code is generated with a MemberExpression against an ObjectExpression. #445

@nullableVoidPtr

Description

@nullableVoidPtr

Proof of concept:

escodegen.generate({
    "type": "MemberExpression",
    "computed": false,
    "object": {
        "type": "ObjectExpression",
        "properties": []
    },
    "property": {
        "type": "Identifier",
        "name": "property"
    }
});

Output:

{}.property

Compared with astring (note the parens around the empty object):

({}).property

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions