Skip to content

Commit d6a6e3a

Browse files
authored
examples/bridge_mod: be more resilient
1 parent 178b251 commit d6a6e3a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

examples/bridge_mod.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ ws.onmessage = async x => {
1515

1616
for (const id in modules) {
1717
const mod = modules[id].exports;
18-
if (!mod?.__esModule) continue;
18+
// if (!mod?.__esModule) continue;
1919

2020
for (const prop in mod) {
21-
if (!mod.hasOwnProperty(prop)) continue;
21+
// if (!mod.hasOwnProperty(prop)) continue;
2222

2323
const candidate = mod[prop];
24-
if (candidate && candidate.register && candidate.wait) {
25-
Dispatcher = candidate;
26-
break;
27-
}
24+
try {
25+
if (candidate && candidate.register && candidate.wait) {
26+
Dispatcher = candidate;
27+
break;
28+
}
29+
} catch {}
2830
}
2931

3032
if (Dispatcher) break;

0 commit comments

Comments
 (0)