<!DOCTYPE html>
|
<html>
|
<head>
|
|
<script type="text/javascript">
|
|
var MyObj = function () { };
|
MyObj.prototype = {
|
constructor: MyObj,
|
|
tooltip: function (text) {
|
|
if (typeof text === "undefined")
|
return "UNDEF_ARG_GIVEN";
|
else
|
return this;
|
},
|
|
otherFunction: function (cnt) {
|
return true;
|
}
|
};
|
|
function _launchTest () {
|
|
var elm = document.getElementById('count-tracker');
|
|
for (var i = 1; i <= 100000; i++) {
|
(new MyObj()).tooltip(null).otherFunction(i);
|
elm.innerHTML = i; // console.log(i);
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div>Watch the JavaScript console for an exception that will appear after a few thousand iterations.</div>
|
|
<div><button type="button" onclick="_launchTest()">Launch Test!</button></div>
|
|
<div id="count-tracker"></div>
|
|
</body>
|
|
</html>
|