From 324200fc430e0352ec077d125e45ed6ee84e2312 Mon Sep 17 00:00:00 2001 From: Yogesh Kumar Date: Mon, 10 Aug 2026 12:57:18 +0530 Subject: [PATCH] lib: document remaining ProxyHandler trap parameters Several ProxyHandler traps document `target` and then stop, leaving the rest of their parameters with no description in hover and signature help: `apply` is missing `thisArg` and `argArray`, `construct` skips `argArray`, `defineProperty` is missing `property` and `attributes`, and `set` skips `newValue`. `setPrototypeOf` has the same symptom for a different reason: it documents `@param newPrototype` while the parameter is named `v`, so the tag matches nothing and the description is dropped. Rename the parameter to `newPrototype` to match both the existing tag and the sibling `set` trap, which already spells its value parameter `newValue` rather than the spec's `V`. --- src/lib/es2015.proxy.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/es2015.proxy.d.ts b/src/lib/es2015.proxy.d.ts index 572870f6a92b1..a54caa182eb69 100644 --- a/src/lib/es2015.proxy.d.ts +++ b/src/lib/es2015.proxy.d.ts @@ -2,12 +2,15 @@ interface ProxyHandler { /** * A trap method for a function call. * @param target The original callable object which is being proxied. + * @param thisArg The `this` argument for the call. + * @param argArray The list of arguments for the call. */ apply?(target: T, thisArg: any, argArray: any[]): any; /** * A trap for the `new` operator. * @param target The original object which is being proxied. + * @param argArray The list of arguments for the constructor. * @param newTarget The constructor that was originally called. */ construct?(target: T, argArray: any[], newTarget: Function): object; @@ -15,6 +18,8 @@ interface ProxyHandler { /** * A trap for `Object.defineProperty()`. * @param target The original object which is being proxied. + * @param property The name or `Symbol` of the property to define. + * @param attributes The descriptor for the property being defined or modified. * @returns A `Boolean` indicating whether or not the property has been defined. */ defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean; @@ -77,6 +82,7 @@ interface ProxyHandler { * A trap for setting a property value. * @param target The original object which is being proxied. * @param p The name or `Symbol` of the property to set. + * @param newValue The new value of the property to set. * @param receiver The object to which the assignment was originally directed. * @returns A `Boolean` indicating whether or not the property was set. */ @@ -87,7 +93,7 @@ interface ProxyHandler { * @param target The original object which is being proxied. * @param newPrototype The object's new prototype or `null`. */ - setPrototypeOf?(target: T, v: object | null): boolean; + setPrototypeOf?(target: T, newPrototype: object | null): boolean; } interface ProxyConstructor {