4 ms·
"accessing missing properties throws" will just lead to a lot of use of try/catch, and the issues that entails. It's frankly doubtful whether it will speed thin
by woah 12y ago
"accessing missing properties throws" will just lead to a lot of use of try/catch, and the issues that entails. It's frankly doubtful whether it will speed things up at all, if there is any penalty to throwing try/catch everywhere.
- the8472 12y agoor you can check first with .hasOwnProperty() or with the in operator
- jahewson 12y agoThat won't be a problem in SoundScript though, because any code which tries to access a property which might be missing is unsound, so it won't "compile" (or rather, it won't pass the type checker).
- barrkel 12y agoIn order for this to work, the type needs to be statically known, which in turn means type casts would be required when asserting a downcast. Javascript littered with casts is nothing I want to see. I don't know about you.