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
It's hard to tell what sort of parameters things take without diving into the code -- and not just looking at the source of the function I'm calling. I just got an exception inside CanvasRenderer.createPattern complaining that it received the wrong type or number of arguments. The stack trace is somewhere in the middle of CanvasRenderer.render() and probably indicates that I gave the wrong type of value to a texture or material constructor -- somewhere far away from any function in the stack trace.
Providing more type annotations where possible would help me catch these errors before I even finish typing them.
The text was updated successfully, but these errors were encountered:
Actually, this exception that I got looks like it might actually be a different bug: CanvasRenderingContext2D says that createPattern takse a canvas_OR_image but it actually takes a CanvasElement or VideoElement. Still, more type annotations would be nice.
I did a lot of this in #165, but there's still quite a bit to do.
Once #166 is resolved, I'd like to do another documentation pass and create a list of functions/types that still need documentation for things I can't figure out.
The style guide recommends adding type annotations for method signatures and omitting them for local variables (unless the function is long). There's an upstream issue for automating checking for missing annotations, but for now it's a manual process.
It's hard to tell what sort of parameters things take without diving into the code -- and not just looking at the source of the function I'm calling. I just got an exception inside CanvasRenderer.createPattern complaining that it received the wrong type or number of arguments. The stack trace is somewhere in the middle of CanvasRenderer.render() and probably indicates that I gave the wrong type of value to a texture or material constructor -- somewhere far away from any function in the stack trace.
Providing more type annotations where possible would help me catch these errors before I even finish typing them.
The text was updated successfully, but these errors were encountered: