Created
December 15, 2010 00:36
-
-
Save sdesai/741411 to your computer and use it in GitHub Desktop.
Attempt at IE9 Preview Release crasher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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