1
0
Fork 0
firefox/dom/base/test/jsmodules/test_scriptNotParsedAsModule.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

23 lines
676 B
HTML

<!DOCTYPE html>
<meta charset=utf-8>
<title>Test classic script not parsed as module</title>
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script>
var wasRun = false;
var hadSyntaxError = false;
SimpleTest.waitForExplicitFinish();
window.onerror = handleError;
function handleError(message, url, line, column, error) {
hadSyntaxError = error instanceof SyntaxError;
}
function testError() {
ok(!wasRun, 'Check script was not run');
ok(hadSyntaxError, 'Check that a SyntaxError was thrown');
SimpleTest.finish();
}
</script>
<script src="module_testSyntax.mjs"></script>
<body onload='testError()'></body>