espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.73k stars 741 forks source link

Storage.writeJSON and Storage.readJSON are incompatible when numeric keys are present #2484

Closed PVTejas closed 2 months ago

PVTejas commented 2 months ago

espruino/Espruino@59dda13 breaks Storage.readJSON in cases where dict keys are purely numeric

require("Storage").writeJSON("test",{"1":1});
require("Storage").readJSON("test");

Throws the error Got INT expected '}'

Related issues:

halemmerich commented 2 months ago

It could be later commits on the same code that break this, https://github.com/espruino/Espruino/commit/59dda13c259888671276a55dbcdb7579223d6329 is just the first introducing the change.

PVTejas commented 2 months ago

That is likely the case. My bad.

gfwilliams commented 2 months ago

Thanks! Just fixed it hopefully so on new firmwares this should all work again