Skip to content

First Argument in Function.prototype.call should be optional #44530

Closed

Description

🕗 Version & Regression Information

Occurs in the latest Version (4.3.2) and nightly version

💻 Code

Function.prototype.call combined with Optional Chaining is a nice way to only call a method if the method is defined (see this thread).

foo?.call()

🙁 Actual behavior

Ts complains: Expected at least 1 arguments, but got 0

🙂 Expected behavior

I expect that this works as the first argument is actually optional according to Mozilla and own observations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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