From 0eb0133b7ffa67da71aabb4f949cb19200b1973e Mon Sep 17 00:00:00 2001 From: Tal Ben-Ari Date: Fri, 15 Feb 2019 14:11:06 -0800 Subject: [PATCH] [PR] Remove shadowed generics in Proxy$traps Summary: In v0.67.0, `Proxy$traps.getOwnPropertyDescriptor` and `Proxy$traps.defineProperty` were erroneously modified with an additional generic, which shadowed the surrounding generic. By removing it, these two methods will now correctly refer to the proxy target's type, instead of an independently inferred type. MDN docs for `getOwnPropertyDescriptor`: MDN docs for `defineProperty`: Pull Request resolved: https://github.com/facebook/flow/pull/6750 Reviewed By: jbrown215 Differential Revision: D14071096 Pulled By: nmote fbshipit-source-id: 659756f6ca2d93ab8ef0b2c9813d67a4592a2991 --- lib/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core.js b/lib/core.js index 4a0e3ce998b..e1239aacf8f 100644 --- a/lib/core.js +++ b/lib/core.js @@ -799,8 +799,8 @@ type Proxy$traps = { setPrototypeOf?: (target: T, prototype: Object|null) => boolean; isExtensible?: (target: T) => boolean; preventExtensions?: (target: T) => boolean; - getOwnPropertyDescriptor?: (target: T, property: string) => void | PropertyDescriptor; - defineProperty?: (target: T, property: string, descriptor: PropertyDescriptor) => boolean; + getOwnPropertyDescriptor?: (target: T, property: string) => void | PropertyDescriptor; + defineProperty?: (target: T, property: string, descriptor: PropertyDescriptor) => boolean; has?: (target: T, key: string) => boolean; get?: (target: T, property: string, receiver: Proxy) => any; set?: (target: T, property: string, value: any, receiver: Proxy) => boolean;