pjs/js/jsdj/ifcui/run/samples/runerr.html

47 строки
892 B
HTML

<html>
<head>
<title>Runtime Error Sample</title>
</head>
<body>
<!--
This demonstrates catching runtime errors in
the debugger and the fact that, while it is
not possible to continue from the error,
the various varibles in the call chain
are alive and can be independently inspected
after pressing the "debug" button in the
debugger's error reporter dialog.
-->
<script language="JavaScript">
function HasError()
{
var local = 4;
return bogus; // this is an intentional runtime error
}
function CallFunWithError()
{
var local = 3;
return HasError();
}
function CallFunThatCallsFunWithError()
{
var local = 2;
return CallFunWithError();
}
var local = 1; // not really local :)
document.writeln( "Errors on purpose (run me in the JavaScript Debugger!)" + "<BR>");
CallFunThatCallsFunWithError();
</script>
</body>
</html>