First, I'm not sure if this should be on SO or meta, but...
When I run the code snippet below, I get one alert instead of two. If I run the same code on jsFiddle or jsbin, I get two alerts as expected.
Is this a flaw in the way snippets are handled on SO?
alert(1);
test = Number(localStorage.test) || 0;
alert(2);
Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag
when running the snippet. This is presumably a deliberate choice, though that's certainly open for clarification. The error thrown by this prevents the second alert from running. – Chris Hayes Feb 22 '15 at 4:43