-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
A lot of time we'll do things like
!!window.foo
elem.style.backgroundSize == ''I think it's a good time to shift all those to use the slightly less invasive in. I've seen at least two occasions where exceptions in bad implementations would have been avoided. Additionally... Adam Barth of WebKit/Blink recommended this approach:
Nit: We'd like to encourage folks to use
"requestFileSystem" in windowrather than actually retrieving the property.Good to know. Most feature detects retrieve the property now only because use of
inis less common. I have encountered a few cases whereinwould have avoided a nasty exception from a poor implementation whereas the property access threw.What is the functional difference between the two, just so I can educate developers?
The "in" pattern avoids allocating memory to back the property. In some cases, we'll boot up the property's subsystem when you instantiate it.
So. instead of the above we'd do..
'foo' in window
'backgroundSize' in elem.styleI dont expect this to change our results anywhere, but I'd like to verify this (at the same time as we verify the massive addTest porting didnt change anything)
2013.08.28: Edited this for clarify.