Hi guys,
Just had a nasty bug that was a bit confusing and I would like know more about.
I've faced some similar situations in the past and I think is good to understand why.
Basically, I've had unexpected behaviour on a function when executed on server side.
I am referring to parseInt -->
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
Is being executed as 2.0.
So I know then that is being executed on an old specification of ECMAScript
String "0005438" after applying server side parseInt it gives you 355.
On Chrome, client side script, it gives for example 5438 --- what's expected.
Might this be the issue? (info from above link)
The ECMAScript 5 specification of the function parseInt no longer allows implementations to treat Strings beginning with a 0 character as octal values.
Just want to know this to think carefully how careful should it be when using these kind of functions in 2.0 scripts.
I guess all these issues should be gone when using 2.1.
But there are a lot of code on my customer currently in 2.0, which probably does not make sense time wise to be executed as 2.1, for all the test required. But then some small bugs as this might arise.
What's your general approach?