News for hackers. Stuff that matters.
Re:In web design, everything easy is hard again by kaoD on Saturday February 10, 2018 @08:36AM (#16347233)
> turns out JS was implicitly casting my string value to octal

How exactly? I'm really curious. AFAIK it's pretty hard for a JS string to be casted into anything (pretty easy the other way around though).

I guess maybe parseInt can do that, but that's neither casting not implicit.

Re:In web design, everything easy is hard again by hnzix on Saturday February 10, 2018 @08:54AM (#16347276)
Looks like it's been fixed in ES5. From memory I was performing an operation on a html color string and if you clicked a color with a certain prefix it would crash.

I could easily reproduce the bug but it took me forever to work out why JS was choking. I think I added in some ridiculous string padding to prevent the auto casting.

https://stackoverflow.com/questions/2547836/why-doesnt-an-oc...

Re:In web design, everything easy is hard again by rwaldron on Saturday February 10, 2018 @02:57PM (#16349231)
> Looks like it's been fixed in ES5

That was published 9 years ago.

Re:In web design, everything easy is hard again by phpnode on Saturday February 10, 2018 @10:25AM (#16347656)
Presumably by calling parseInt('010') which used to detect zero leading strings as octal.