Skip to content

Commit

Permalink
[PR] Remove shadowed generics in Proxy$traps
Browse files Browse the repository at this point in the history
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`:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor>

MDN docs for `defineProperty`:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/defineProperty>
Pull Request resolved: #6750

Reviewed By: jbrown215

Differential Revision: D14071096

Pulled By: nmote

fbshipit-source-id: 659756f6ca2d93ab8ef0b2c9813d67a4592a2991
  • Loading branch information
talbenari1 authored and facebook-github-bot committed Feb 15, 2019
1 parent 12dd2bb commit 0eb0133
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,8 @@ type Proxy$traps<T> = {
setPrototypeOf?: (target: T, prototype: Object|null) => boolean;
isExtensible?: (target: T) => boolean;
preventExtensions?: (target: T) => boolean;
getOwnPropertyDescriptor?: <T>(target: T, property: string) => void | PropertyDescriptor<T>;
defineProperty?: <T>(target: T, property: string, descriptor: PropertyDescriptor<T>) => boolean;
getOwnPropertyDescriptor?: (target: T, property: string) => void | PropertyDescriptor<T>;
defineProperty?: (target: T, property: string, descriptor: PropertyDescriptor<T>) => boolean;
has?: (target: T, key: string) => boolean;
get?: (target: T, property: string, receiver: Proxy<T>) => any;
set?: (target: T, property: string, value: any, receiver: Proxy<T>) => boolean;
Expand Down

0 comments on commit 0eb0133

Please sign in to comment.