@dwallersv, even if you would have access to the prototype, the code is not working as intended, because line 2 overwrites the fillRect() of the 'original' prototype you tried to 'save' in line 1. Line 1 does not make a deep-copy... it only creates a 2nd reference to the prototype object...
Given only this small snippet and no other context, it is not clear to me what this is referencing at runtime...
@allObjects: In a prototype function 'this' will reference the particular instance of an object created with the 'new' keyword -- that's my understanding :-)
@Gordon: Unfortunately, trying to save the function object in a different reference doesn't work -- the native compiled code doesn't expose the symbols, so not even the prototype object referenced by the Graphics.prototype property isn't exposed.
Don't think this can be done without compiling the Graphics "class" with more information -- maybe debug symbols or something.
Don't waste any more time on this guys (other than your own curiosity). It's not important to what I'm doing. Thanks!
© Espruino, powered by microcosm.
Report a problem