镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

ProxyHandler.apply method #42894

Description

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

Activity

  1. ExE-Boss commented on Feb 20, 2021

    @ExE-Boss
    Contributor

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

  2. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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