Skip to content

repl: autocompletion after new X. targets new X(), not X #60306

@Renegade334

Description

@Renegade334

Version

25.0.0

Platform


Subsystem

repl

What steps will reproduce the bug?

> class X { x = 1 }
undefined
> X.Y = class Y { y = 2 }
[class Y]
> new X. <[Tab]> <[Tab]>
new X.__proto__             new X.hasOwnProperty        new X.isPrototypeOf         new X.propertyIsEnumerable
new X.toLocaleString        new X.toString              new X.valueOf

new X.constructor

new X.x

How often does it reproduce? Is there a required condition?

 

What is the expected behavior? Why is that the expected behavior?

Property access has higher precedence than new, so this should autocomplete from the properties of X.

What do you see instead?

Autocompletion from the properties of new X(). If X is not a constructor, offers nothing.

Additional information

The fact that the completer also triggers side-effects from calling the constructor in question is less than ideal, but this isn't the first issue on that front.

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