Skip to content

Commit 610c3a9

Browse files
committed
save a few bytes
1 parent 46ccec3 commit 610c3a9

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

build/devices/pebble/host/main.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ globalThis.device = Object.freeze({
8989
}
9090
}, true);
9191

92+
const hook = function(specifier) {
93+
if (AppInfo.isWatchface && blockedWatchFace.includes(specifier))
94+
throw new Error(specifier + " blocked in watchface");
95+
96+
return {namespace: specifier}; // map through host modules
97+
};
98+
9299
export default function() {
93100
state.archive = (new ArchiveResource())?.archive;
94101
console.log(`Found mod "${state.archive.name}"`);
@@ -156,18 +163,8 @@ export default function() {
156163
state.mod = new ArchiveCompartment(state.archive, {
157164
globals,
158165
modules: {},
159-
loadNowHook(specifier) {
160-
if (AppInfo.isWatchface && blockedWatchFace.includes(specifier))
161-
throw new Error(specifier + " blocked in watchface");
162-
163-
return {namespace: specifier}; // map through host modules
164-
},
165-
loadHook(specifier) {
166-
if (AppInfo.isWatchface && blockedWatchFace.includes(specifier))
167-
throw new Error(specifier + " blocked in watchface");
168-
169-
return {namespace: specifier}; // map through host modules
170-
}
166+
loadNowHook: hook,
167+
loadHook: hook
171168
});
172169

173170
Timer.set(async () => {

0 commit comments

Comments
 (0)