File tree 2 files changed +8
-5
lines changed 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -317,8 +317,8 @@ added: REPLACEME
317
317
* {string} The directory name of the current module. This is the same as the
318
318
[ ` path.dirname() ` ] [ ] of the [ ` import.meta.__filename ` ] [ ] .
319
319
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.
322
322
323
323
### ` import.meta.__filename `
324
324
@@ -330,8 +330,8 @@ added: REPLACEME
330
330
file's absolute path with symlinks resolved. This is the same as the
331
331
[ ` url.fileURLToPath() ` ] [ ] of the [ ` import.meta.url ` ] [ ] .
332
332
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.
335
335
336
336
### ` import.meta.url `
337
337
@@ -1624,7 +1624,6 @@ for ESM specifiers is [commonjs-extension-resolution-loader][].
1624
1624
[` data:` URLs]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
1625
1625
[` export` ]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export
1626
1626
[` import()` ]: #import-expressions
1627
- [` import.meta.__dirname` ]: #importmeta__dirname
1628
1627
[` import.meta.__filename` ]: #importmeta__filename
1629
1628
[` import.meta.resolve` ]: #importmetaresolvespecifier-parent
1630
1629
[` import.meta.url` ]: #importmetaurl
Original file line number Diff line number Diff line change @@ -24,3 +24,7 @@ assert(import.meta.__dirname.match(dirReg));
24
24
25
25
const 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 $ / ;
26
26
assert ( 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