Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide better error when creating a namespace object containing a re…
…exported external namespace (#2499) * Provide better error when creating a namespace object containing a reexported external namespace * Fix windows path error
- Loading branch information
1 parent
a3be30d
commit 0707a10
Showing
5 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
test/function/samples/internal-reexports-from-external/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
description: | ||
'fails with a helpful error if creating a namespace object containing a reexported external namespace', | ||
options: { | ||
external: ['external'] | ||
}, | ||
error: { | ||
code: 'NAMESPACE_CANNOT_CONTAIN_EXTERNAL', | ||
message: | ||
'Cannot create an explicit namespace object for module "reexport" because it contains a reexported external namespace', | ||
id: path.join(__dirname, '/reexport.js') | ||
} | ||
}; |
3 changes: 3 additions & 0 deletions
3
test/function/samples/internal-reexports-from-external/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as namespace from './reexport.js'; | ||
|
||
console.log(namespace); |
1 change: 1 addition & 0 deletions
1
test/function/samples/internal-reexports-from-external/reexport.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'external'; |