Skip to content

Type of Array.prototype[Symbol.unscopables] is wrong #46616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Jack-Works opened this issue Nov 1, 2021 · 3 comments · Fixed by #42566
Closed

Type of Array.prototype[Symbol.unscopables] is wrong #46616

Jack-Works opened this issue Nov 1, 2021 · 3 comments · Fixed by #42566
Assignees
Labels
Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Rescheduled This issue was previously scheduled to an earlier milestone

Comments

@Jack-Works
Copy link
Contributor

lib Update Request

In lib.es2015.symbol.wellknown.d:

interface Array<T> {
    /**
     * Returns an object whose properties have the value 'true'
     * when they will be absent when used in a 'with' statement.
     */
    [Symbol.unscopables](): {
        copyWithin: boolean;
        entries: boolean;
        fill: boolean;
        find: boolean;
        findIndex: boolean;
        keys: boolean;
        values: boolean;
    };
}

Configuration Check

My compilation target is ES2015 and my lib is the default.

Missing / Incorrect Definition

It is an object, instead of a function that returns an object.

Sample Code

Documentation Link

@MartinJohns
Copy link
Contributor

MartinJohns commented Nov 1, 2021

It being an object seems to be right, according to the MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/unscopables

What makes you think it should be a function returning an object?

@Jack-Works
Copy link
Contributor Author

The current definition in TypeScript is a function

@MartinJohns
Copy link
Contributor

Related: #34610

It was wrongly fixed. :-D

@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.6.0 milestone Nov 4, 2021
@DanielRosenwasser DanielRosenwasser added the Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript label Nov 4, 2021
@RyanCavanaugh RyanCavanaugh added the Rescheduled This issue was previously scheduled to an earlier milestone label May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Rescheduled This issue was previously scheduled to an earlier milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants