Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
step_timeout(() => {
const importMapScript = document.createElement('script');
importMapScript.type = 'importmap';
importMapScript.textContent = JSON.stringify({
imports: {
"../resources/log.sub.js?name=A": "../resources/log.sub.js?name=B"
}
});
document.head.appendChild(importMapScript);
}, 100);
</script>
<script>
const log = [];
</script>
<script type="module" src="../resources/importer.sub.js?pipe=trickle(d0.5)&name=..%2Fresources%2Flog.sub.js%3Fname%3DA"></script>
<script type="module">
test(() => {
assert_array_equals(log, ["log:B"], "Import should use the new import map");
}, "Module tree that started to download before a new import map should still take it into account");
</script>
</body>
</html>