Skip to content

Instantly share code, notes, and snippets.

@sdesai
Created December 15, 2010 00:36
Show Gist options
  • Save sdesai/741411 to your computer and use it in GitHub Desktop.
Save sdesai/741411 to your computer and use it in GitHub Desktop.
Attempt at IE9 Preview Release crasher
<!DOCTYPE html PUBLIC "-//W3C/DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head></head>
<body>
<button id="btn">Go</button>
<script>
var runner;
function Runner(n) {
this.n = n;
this.stop = false;
};
Runner.prototype._run = function() {
console.log("foo, " + this.n);
if (--(this.n) > 0) {
runner._run();
} else if (!this.stop) {
this._resumeTest();
}
};
Runner.prototype._resumeTest = function() {
if (typeof setTimeout != "undefined") {
setTimeout(function() {
runner.stop = true;
runner._run();
}, 0);
}
};
Runner.prototype.run = function() {
this._run();
};
document.getElementById("btn").onclick = function() {
runner = new Runner(2);
runner.run();
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment