A directive to solve the JavaScript arithmetic precision issue

Kyle Simpson getify at gmail.com
Mon Aug 15 11:45:42 PDT 2011


> A directive would have the same benefits than use strict which is to not
> break existing code in platform that do not support this directive.

It would also have the same limitation that "use strict"; does, which is 
that it doesn't play well with (the quite common pattern of) concat'ing 
minified scripts together in build environment deployments, because your 
"use stict" declaration in one of your files bleeds over (probably 
unintentionally) to affecting other files when they are all combined into 
one file.

Maybe something like:

use "sensible arithmetic" {
 // ..
};

Perhaps? In any case, I'm definitely not a fan of continuing the frustration 
that "use strict" gives us in concat-js environments.

--Kyle

 



More information about the es-discuss mailing list