4 ms·
Strict mode was opt in though, and code would still evaluate without it. There's also a lot of new syntax though, which does have high costs in cases like gene
by sammorrowdrums 7y ago
Strict mode was opt in though, and code would still evaluate without it.
There's also a lot of new syntax though, which does have high costs in cases like generators, and shipping the regenerator runtime because you need your code to run everywhere.
To my knowledge they have extended syntax and added modes, but not actually made any breaking changes.
A mode was a way to avoid making breaking changes.
What I missed from my comment is not just about the engines in use, but also that all old spec confirming JavaScript should still run, in all new environments.
That is backwards compatibility.
- matthewbauer 7y agoI suppose if you happened to previously have code with the string 'use strict'; at the top, and did non-strict things below, it would break. In a very small scale, that does break backwards compatibility.
- sammorrowdrums 7y agoI'd love to find out if there was anyone affected in reality. It seems improbable, as random string statements with no assignment is a pretty niche way to comment code, or surely it would have been mistake. But there's so much poorly written JS on the web that there is a chance!
- kybernetikos 7y ago> parseInt("012") Modern browsers will say 12, old browsers (IE 8 and down) will say 10.
- sammorrowdrums 7y agoGreat example, I guess I forgot that a few changes were made that otherwise did surprising things. They also changed to (at least more) deterministic ordering of object keys and I wonder how much code worked
- sammorrowdrums 7y agoGreat example, I guess I forgot that a few changes were made that otherwise did surprising things. They also changed to a (more) deterministic ordering of object keys and I wonder how much software behaved differently / broke as a consequence... My "favourite" JS quirk is some of the IE versions where it would break if you called console.log without the console open, as it was undefined. So many quirks, I think I may have slightly overstated the compatibility element.