Skip to content

Object.getOwnPropertyDescriptor(CanvasRenderingContext2D.prototype, "strokeStyle"); #1460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dreamsky124 opened this issue Jul 21, 2019 · 3 comments

Comments

@dreamsky124
Copy link

Object.getOwnPropertyDescriptor(CanvasRenderingContext2D.prototype, "strokeStyle");

"TypeError: Method strokeStyle called on incompatible receiver [object Object]

others no problem
eg: Object.getOwnPropertyDescriptor(CanvasRenderingContext2D.prototype, "fillText");

Environment

node-cavas:2.5.0
node:V10.16.0
windows7 64bit

@zbjornson
Copy link
Collaborator

fillText is a method, strokeStyle is a getter/setter. You'll see the same TypeError for all getters/setters.

This is intentional since #808. Neither Chrome nor Firefox have this behavior (they return the descriptor), but I'm not sure we can do the same from a native module.

@BridgeAR
Copy link

@zbjornson I would expect the getter/setter to be returned along a descriptor. Is it possible to change that somehow? Currently V8 is not able to handle this: nodejs/node#39866 (comment)

@zbjornson
Copy link
Collaborator

@BridgeAR if there is, I don't know how. Do you know who we could ask who's more deeply familiar with the V8 API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants