Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: dom/base/test/jsmodules/chrome.toml
<!DOCTYPE html>
<meta charset=utf-8>
<title>Test classic script not parsed as module</title>
<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>