Re:ESnext – Tomorrow’s JavaScript syntax today
by skrebbel on Sunday October 12, 2014 @02:37PM
(#8446154)
Could you explain how? I thought "use strict" only added more runtime checking, but does not change the semantics. Wouldn't IE9 just interpret the line as a bogus expression and move on?
Re:ESnext – Tomorrow’s JavaScript syntax today
by Zardoz84 on Monday October 13, 2014 @03:58AM
(#8447865)
I use "use strict" on JavaScript that runs over IE8/9 and I don't get errors from it.
Re:ESnext – Tomorrow’s JavaScript syntax today
by girvo on Monday October 13, 2014 @05:03AM
(#8447997)
That's because "use strict" is ignored in IE8/9 (thankfully). You usually won't run into any issues, but if you're relying on strict-mode for certain semantics you can run into some very subtle bugs. The chances of that are super low though, I've only ever done it on purpose :)
P.S. IE9 doesn't support ES5 strict mode so "use strict" might introduce some subtle bugs for that case.