espruino / Espruino

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

Fix RJSON's object parsing #2436

Closed bobrippling closed 7 months ago

bobrippling commented 7 months ago

Found in espruino/BangleApps#3114, object parsing exits early for strings with an empty object:

>JSON.parse('{"c":1}')
={  }

Or if we've parsed in a relaxed mode and hit a string, I'd expect us to exit with that object on hitting a string key, but I'm not sure how to enable the relaxed mode parsing from an espruino prompt.

Closes espruino/BangleApps#3114

gfwilliams commented 7 months ago

Thanks! Wow, sorry - that was a really stupid bug to introduce!

bobrippling commented 7 months ago

Thanks for the follow up too! I need to get setup for running locally, was flying blind with that one

gfwilliams commented 7 months ago

:) No problem! If you're on Windows it's worth installing WSL - once that's installed, you can git clone it and it should 'just work' with make