@@ -149,7 +149,7 @@ describe("import() resolution table", function () {
149149 [ "esm" , "ns:import-pin-missing" , "rejected:Error:No such built-in module: ns:import-pin-missing" ] ,
150150 [ "esm" , function ( ) { return blobUrl ; } , "ok:blob" ] ,
151151 [ "esm" , function ( ) { return blobUrl + "?x" ; } , "rejected:Error:Blob not found: <blob>?x" ] ,
152- [ "esm" , function ( ) { return blobUrl + "#f" ; } , "rejected:Error:Blob not found: < blob>#f " ] ,
152+ [ "esm" , function ( ) { return blobUrl + "#f" ; } , "ok: blob" ] ,
153153 [ "esm" , "./missing.mjs" , "rejected:Error:Cannot find module './missing.mjs' (tried <app>/esm/import-pin/missing.mjs)" ] ,
154154 [ "esm" , "~/esm/import-pin/missing.mjs" , "rejected:Error:Cannot find module '~/esm/import-pin/missing.mjs' (tried <app>/app/esm/import-pin/missing.mjs)" ] ,
155155 [ "esm" , "./syntax-error.mjs" , "rejected:SyntaxError:Unexpected token ';'" ] ,
@@ -178,7 +178,7 @@ describe("import() resolution table", function () {
178178 [ "cjs" , "ns:module" , "ok:createRequire=function" ] ,
179179 [ "cjs" , function ( ) { return blobUrl ; } , "ok:blob" ] ,
180180 [ "cjs" , function ( ) { return blobUrl + "?x" ; } , "rejected:Error:Blob not found: <blob>?x" ] ,
181- [ "cjs" , function ( ) { return blobUrl + "#f" ; } , "rejected:Error:Blob not found: < blob>#f " ] ,
181+ [ "cjs" , function ( ) { return blobUrl + "#f" ; } , "ok: blob" ] ,
182182 [ "cjs" , "./missing.mjs" , "rejected:Error:Cannot find module './missing.mjs' (tried <app>/esm/import-pin/missing.mjs)" ] ,
183183 [ "cjs" , "./throws.mjs" , "rejected:TypeError:import-pin evaluation error" ] ,
184184
@@ -191,7 +191,7 @@ describe("import() resolution table", function () {
191191 [ "newFunction" , "/esm/import-pin/leaf.mjs" , "ok:leaf" ] ,
192192 [ "newFunction" , "file:///app/esm/import-pin/leaf.mjs" , "ok:leaf" ] ,
193193 [ "newFunction" , "ns:module" , "ok:createRequire=function" ] ,
194- [ "newFunction" , function ( ) { return blobUrl + "#f" ; } , "rejected:Error:Blob not found: < blob>#f " ] ,
194+ [ "newFunction" , function ( ) { return blobUrl + "#f" ; } , "ok: blob" ] ,
195195
196196 [ "indirectEval" , "./leaf.mjs" , "rejected:Error:Cannot find module './leaf.mjs' (tried <app>/tests/leaf.mjs)" ] ,
197197 [ "indirectEval" , "./esm/import-pin/leaf.mjs" , "rejected:Error:Cannot find module './esm/import-pin/leaf.mjs' (tried <app>/tests/esm/import-pin/leaf.mjs)" ] ,
@@ -214,7 +214,7 @@ describe("import() resolution table", function () {
214214 [ "http" , "ns:module" , "ok:createRequire=function" ] ,
215215 [ "http" , function ( ) { return blobUrl ; } , "ok:blob" ] ,
216216 [ "http" , function ( ) { return blobUrl + "?x" ; } , "rejected:Error:Blob not found: <blob>?x" ] ,
217- [ "http" , function ( ) { return blobUrl + "#f" ; } , "rejected:Error:Blob not found: < blob>#f " ] ,
217+ [ "http" , function ( ) { return blobUrl + "#f" ; } , "ok: blob" ] ,
218218 ] ;
219219
220220 var rowCount = 0 ;
@@ -268,6 +268,17 @@ describe("import() resolution table", function () {
268268 } ) ;
269269 } ) ;
270270
271+ it ( "from esm: the same namespace for a blob URL with and without a fragment" , function ( done ) {
272+ Promise . all ( [ importers . esm ( blobUrl ) , importers . esm ( blobUrl + "#g" ) ,
273+ importers . cjs ( blobUrl + "#h" ) ] ) . then ( function ( r ) {
274+ expect ( [ r [ 0 ] === r [ 1 ] , r [ 0 ] === r [ 2 ] ] ) . toEqual ( [ true , true ] ) ;
275+ done ( ) ;
276+ } , function ( e ) {
277+ expect ( "rejected:" + describeError ( e ) ) . toBe ( "resolved" ) ;
278+ done ( ) ;
279+ } ) ;
280+ } ) ;
281+
271282 it ( "from esm: JSON with a type attribute" , function ( done ) {
272283 import ( dir + "importer.mjs" ) . then ( function ( m ) {
273284 return outcome ( m . load ( "./data.json" , { with : { type : "json" } } ) ) ;
0 commit comments