espruino / espruino/BangleApps
widcache corrupted with comment in last line
- Dominant language
- JavaScript
- Stars
- 571
- Forks
- 1.3k
- Avg merge
- 17h 38m
- Merged PRs (30d)
- 17
Description
### Affected hardware version
Bangle 2
### Your firmware version
2v27
### The bug
When uploading a widget via Web IDE and the last line has a comment (like in the [example](https://www.espruino.com/Bangle.js+Widgets) the .widcache file gets corrupted.
```
Uncaught SyntaxError: Got EOF expected '}'
at eval (.widcache:105:95)
...orEach(k=>WIDGETS[k]=W[k]);
^
at loadWidgets (.boot0:8:91)
...Storage").read(".widcache"))
^
at eval (antonclk.app.js:3:376)
...ton;}});Bangle.loadWidgets();draw();setTimeout(Bangle.drawWi...
^
at boot code (.bootcde:9:13)
eval(_clkApp);
^
```
.widcache:
```
// Bangle.drawWidgets(); // <-- for development only}catch(e){print("hpa.wid.js",e,e.stack)}
```
Simplest solution is to add an additional line break
### Expected Behaviour
bootupdate.js should handle this
### Installed apps
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.