From 9185793042c7bfddba13333d33f678c2ca246e5d Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 24 Oct 2024 20:09:19 +0100 Subject: [PATCH] use slightly slower code to deal with the fact that many apps put semi-colons on clockinfo/settings that are supposed to be evaluated --- apps/boot/bootupdate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/boot/bootupdate.js b/apps/boot/bootupdate.js index 416d5939c..a10a0cb15 100644 --- a/apps/boot/bootupdate.js +++ b/apps/boot/bootupdate.js @@ -133,7 +133,7 @@ let outputFile = (dst,src,pre,post) => {"ram"; if (src.endsWith("clkinfo.js") && f[0]!="(") { /* we shouldn't have to do this but it seems sometimes (sched 0.28) folks have used libraries which get added into the clockinfo, and we can't use them directly - to we have to rever back to eval. */ + to we have to revert back to eval */ f = `eval(require('Storage').read(${E.toJS(src)}))`; } if (dst) { @@ -195,7 +195,7 @@ let ciFiles = require("Storage").list(/\.clkinfo\.js$/); let ci = `// Made by bootupdate.js\n`; if (DEBUG) ci+="var _tm=Date.now();"; outputFileComplete = (dst,fn) => { - outputFile(dst,fn,"try{let a=",`(),b=menu.find(x=>x.name===a.name);if(b)b.items=b.items.concat(a.items)else menu=menu.concat(a);}catch(e){print(${E.toJS(fn)},e,e.stack)}\n`); + outputFile(dst,fn,"try{let fn=",`;let a=fn(),b=menu.find(x=>x.name===a.name);if(b)b.items=b.items.concat(a.items)else menu=menu.concat(a);}catch(e){print(${E.toJS(fn)},e,e.stack)}\n`); }; fileOffset = ci.length; ciFiles.forEach(fn=>outputFileComplete(undefined,fn)); // just get sizes