Skip to content

Conversation

HerringtonDarkholme
Copy link
Contributor

The correction is according to:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getPrototypeOf
and
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/construct

getPrototypeOf trap should return a nullable Object and construct should return an Object.

Though Object is treated as {} in TypeScript which does include primitive value, this change is enough for preventing user from forgetting to return value.

@@ -1,5 +1,5 @@
interface ProxyHandler<T> {
getPrototypeOf? (target: T): any;
getPrototypeOf? (target: T): Object | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use {} instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Still I wonder whether is using {} clearer than Object? I know that these two are confusing for newcomers. But at least Object suggests non-primitive values.

@HerringtonDarkholme
Copy link
Contributor Author

node 4 build fails. tslint requires update.

@mhegazy mhegazy merged commit 4166eeb into microsoft:master Nov 13, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants