script-descendent.html (826B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 </head> 7 <body> 8 <script type="module"> 9 import "../resources/log.js?pipe=sub&name=A"; 10 </script> 11 <script> 12 const log = []; 13 14 // Try to redefine the descendent with an import map 15 </script> 16 <script type="importmap"> 17 { 18 "imports": { 19 "../resources/log.js?pipe=sub&name=A": "../resources/log.js?pipe=sub&name=B" 20 } 21 } 22 </script> 23 <script type="module"> 24 // Testing that the resolution is correct using `resolve`, as you can't import 25 // the same module twice. 26 test(() => { 27 assert_true(import.meta.resolve("../resources/log.js?pipe=sub&name=A") 28 .endsWith("/resources/log.js?pipe=sub&name=A")); 29 }, "Resolution after import map should not be redefined"); 30 </script> 31 </body> 32 </html>