-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support external star exports on namespace objects
- Loading branch information
1 parent
925e42c
commit 1305abb
Showing
5 changed files
with
66 additions
and
45 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: 6 additions & 9 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 |
---|---|---|
@@ -1,16 +1,13 @@ | ||
const path = require('path'); | ||
const assert = require('assert'); | ||
const fs = require('fs'); | ||
|
||
module.exports = { | ||
description: | ||
'fails with a helpful error if creating a namespace object containing a reexported external namespace', | ||
options: { | ||
external: ['external'] | ||
external: ['fs'], | ||
}, | ||
exports(ns) { | ||
assert.strictEqual(ns.namespace.readFile, fs.readFile); | ||
}, | ||
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'), | ||
watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, '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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import * as namespace from './reexport.js'; | ||
|
||
console.log(namespace); | ||
export { namespace }; |
2 changes: 1 addition & 1 deletion
2
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 |
---|---|---|
@@ -1 +1 @@ | ||
export * from 'external'; | ||
export * from 'fs'; |