-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.mjs
29 lines (22 loc) · 907 Bytes
/
index.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (C) Microsoft Corp. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import { installErrorStackModuleAnnotations } from './node_modules/@microsoft/edge-devtools-crash-analyzer-support/dist/index.mjs';
import { demonstrateError} from './demonstrate-error.mjs';
installErrorStackModuleAnnotations(Error);
document.querySelector('#show').onclick = () => {
demonstrateError();
}
async function failAsynchronously() {
await new Promise(resolve => requestAnimationFrame(resolve));
demonstrateError();
}
document.querySelector('#show-async').onclick = () => {
failAsynchronously();
}
window.onerror = (_m, _s, _l, _c, error) => {
document.querySelector('#output').textContent = error.stack;
};
window.onunhandledrejection = event => {
document.querySelector('#output').textContent = event.reason.stack;
};