You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get it, but this feels like a distinctly ES5-ism. Is it possible to explicitly provide the necessary configuration options through to a normally constructed new Sprite instance? I feel like this risks sharing actual objects (like effects) if we aren't careful.
As far as I can tell Object.create doesn't even call the class constructor (just creating an object whose internal prototype is the provided prototype). It feels really weird to me to "construct" a new instance in a way which bypasses the stated constructor.
I'll branch this off into its own issue since it probably takes some investigation (and deciding if it's worth it), and isn't really relevant to this PR, just wanted to give you a heads up on it since the odd look of the code itself is a little exacerbated with TypeScript.
The text was updated successfully, but these errors were encountered:
Particularly this code (and the rest of this method):
leopard/src/Sprite.ts
Lines 508 to 518 in c7e793b
See my comments:
I get it, but this feels like a distinctly ES5-ism. Is it possible to explicitly provide the necessary configuration options through to a normally constructed new
Sprite
instance? I feel like this risks sharing actual objects (likeeffects
) if we aren't careful.As far as I can tell
Object.create
doesn't even call the class constructor (just creating an object whose internal prototype is the provided prototype). It feels really weird to me to "construct" a new instance in a way which bypasses the stated constructor.I'll branch this off into its own issue since it probably takes some investigation (and deciding if it's worth it), and isn't really relevant to this PR, just wanted to give you a heads up on it since the odd look of the code itself is a little exacerbated with TypeScript.
The text was updated successfully, but these errors were encountered: