Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
52 lines (44 sloc) 1.52 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script type="text/javascript" charset="utf-8" src="lib/long-stack-traces.js"></script>
<script type="text/javascript" charset="utf-8">
function initSecondTimeout(tag) {
setTimeout(function secondTimeout() {
try {
throw new Error(tag);
} catch (e) {
console.log(e.stack)
}
}, 1000);
}
function onload() {
// function f() {
// throw new Error('foo');
// }
// setTimeout(f, Math.random()*1000);
// setTimeout(f, Math.random()*1000);
setTimeout(function firstTimeout() {
initSecondTimeout("timeout");
}, 1000);
document.getElementById("button").addEventListener("click", function baz() {
initSecondTimeout("click");
}, false);
var req = new XMLHttpRequest();
req.onreadystatechange = function() {
if (this.readyState === 4) {
initSecondTimeout("onreadystatechange");
}
}
req.open("GET", "README.md", false);
req.send();
}
</script>
</head>
<body onload="onload();">
<input type="button" value="click me!" id="button">
</body>
</html>