How does static checking work with dynamic types? Can the type checker figure out if a field/method exists on a type given that it can be added dynamically?
Edit: I assume it just checks bool/number/string and doesn't care about prototypes?
It does care about prototypes. So it checks for inconsistencies between methods added to a prototype and their uses. The tradeoff is that for dynamically added properties, it doesn't always remember where they are defined and where they remain undefined (it knows they are defined "somewhere").
Edit: I assume it just checks bool/number/string and doesn't care about prototypes?