Skip to content

ProxyHandler.apply method #42894

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
icecream17 opened this issue Feb 20, 2021 · 1 comment · Fixed by #35594
Closed

ProxyHandler.apply method #42894

icecream17 opened this issue Feb 20, 2021 · 1 comment · Fixed by #35594

Comments

@icecream17
Copy link

icecream17 commented Feb 20, 2021

lib Update Request

Configuration Check

My compilation target is ESNext and my lib is ESNext.

The method is in the file: lib.es2015.proxy.d.ts
[According to vscode command (Go to Definition)]

Missing / Incorrect Definition

This is about an incorrect method:
ProxyHandler.apply()
(The second argument to the Proxy constructor)

Current type definition:

    apply? (target: T, thisArg: any, argArray?: any): any;

Actual type definition:

    apply? (target: T, thisArg: any, argArray?: any[]): any;

Sample Code

<!--
  What's some code using this that should work, but doesn't?
-->

This only makes this method even stricter,
so the only effect will be to make more code fail.

Documentation Link

https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist
Step 7 specifically creates an array, which is passed as the third argument to the ProxyHandler.apply method.

Edit

This also applies to ProxyHandler.construct

@ExE-Boss
Copy link
Contributor

This was already fixed by #35594 which will be released in TypeScript 4.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants