37 lines
828 B
HTML
37 lines
828 B
HTML
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
|
<html>
|
|
<head>
|
|
<script src="../../resources/js-test-pre.js"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
description("Exceptions thrown in javascript URLs should not propagate to the main script.")
|
|
|
|
var subframe = document.createElement("iframe");
|
|
document.body.appendChild(subframe);
|
|
|
|
var caughtException = false;
|
|
|
|
// Runtime exception.
|
|
try {
|
|
subframe.src = 'javascript:throw 42';
|
|
} catch(e) {
|
|
caughtException = true;
|
|
}
|
|
shouldBeFalse('caughtException');
|
|
|
|
var subframe2 = document.createElement("iframe");
|
|
document.body.appendChild(subframe2);
|
|
|
|
// Compile-time exception.
|
|
try {
|
|
subframe2.src = 'javascript:<html></html>';
|
|
} catch(e) {
|
|
caughtException = true;
|
|
}
|
|
shouldBeFalse('caughtException');
|
|
</script>
|
|
<script src="../../resources/js-test-post.js"></script>
|
|
</body>
|
|
</html>
|