Skip to content

Commit 95b18db

Browse files
committed
fix: window.onerror needs to be called safely
1 parent 41d3092 commit 95b18db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/runtime/browser-vm/src/sandbox.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ export class Sandbox {
285285
if (typeof this.global.onerror === 'function') {
286286
const source = url || this.options.baseUrl;
287287
const message = e instanceof Error ? e.message : String(e);
288-
this.global.onerror.call(this.global, message, source, null, null, e);
288+
safeWrapper(() => {
289+
this.global.onerror.call(this.global, message, source, null, null, e);
290+
});
289291
}
290292
throw e;
291293
} finally {

0 commit comments

Comments
 (0)