File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -317,8 +317,8 @@ added: REPLACEME
317317* {string} The directory name of the current module. This is the same as the
318318 [ ` path.dirname() ` ] [ ] of the [ ` import.meta.__filename ` ] [ ] .
319319
320- > ** Caveat** only local modules support this property. Modules not using the ` file: ` protocol will
321- > not provide it.
320+ > ** Caveat** only local modules support this property. Modules not using the
321+ > ` file: ` protocol will not provide it.
322322
323323### ` import.meta.__filename `
324324
@@ -330,8 +330,8 @@ added: REPLACEME
330330 file's absolute path with symlinks resolved. This is the same as the
331331 [ ` url.fileURLToPath() ` ] [ ] of the [ ` import.meta.url ` ] [ ] .
332332
333- > ** Caveat** only local modules support this property. Modules not using the ` file: ` protocol will
334- > not provide it.
333+ > ** Caveat** only local modules support this property. Modules not using the
334+ > ` file: ` protocol will not provide it.
335335
336336### ` import.meta.url `
337337
@@ -1624,7 +1624,6 @@ for ESM specifiers is [commonjs-extension-resolution-loader][].
16241624[` data:` URLs]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
16251625[` export` ]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export
16261626[` import()` ]: #import-expressions
1627- [` import.meta.__dirname` ]: #importmeta__dirname
16281627[` import.meta.__filename` ]: #importmeta__filename
16291628[` import.meta.resolve` ]: #importmetaresolvespecifier-parent
16301629[` import.meta.url` ]: #importmetaurl
Original file line number Diff line number Diff line change @@ -24,3 +24,7 @@ assert(import.meta.__dirname.match(dirReg));
2424
2525const fileReg = / ^ \/ .* \/ t e s t \/ e s - m o d u l e \/ t e s t - e s m - i m p o r t - m e t a \. m j s $ / ;
2626assert ( import . meta. __filename . match ( fileReg ) ) ;
27+
28+ // Verify that `data:` imports do not behave like `file:` imports.
29+ import dataDirname from 'data:text/javascript,const a = import.meta.__dirname;export default a;' ;
30+ assert . strictEqual ( dataDirname , undefined ) ;
You can’t perform that action at this time.
0 commit comments