Open dreamsky124 opened 5 years ago
fillText
is a method, strokeStyle
is a getter/setter. You'll see the same TypeError for all getters/setters.
This is intentional since https://github.com/Automattic/node-canvas/pull/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.
@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: https://github.com/nodejs/node/issues/39866#issuecomment-907257552
@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?
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