On 22/09/2011, at 8:19 PM, Anders Jönsson wrote:

> function supports_html5_storage() {
>    try {
>        return typeof window.localStorage !== 'undefined';
>    } catch (e) {
>        return false;
>    }
> }

`try.. catch` is being used here because Firefox 4 (beta to be specific). There 
were cases when Firefox 4 Beta threw an error[1]. Check the link and read the 
comments for more information.



> And can we also remove the try...catch?:


It should be okay to remove them now.



[1] https://github.com/Modernizr/Modernizr/blob/master/modernizr.js#L700

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to