File tree Expand file tree Collapse file tree 4 files changed +23
-5
lines changed
test/cases/scope-hoisting/issue-7930 Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -1447,9 +1447,9 @@ class HarmonyExportImportedSpecifierDependencyConcatenatedTemplate {
1447
1447
if ( ! used ) {
1448
1448
source . insert (
1449
1449
- 1 ,
1450
- `/* unused concated harmony import ${ dep . name } */\n`
1450
+ `/* unused concated harmony import ${ def . name } */\n`
1451
1451
) ;
1452
- return ;
1452
+ continue ;
1453
1453
}
1454
1454
let finalName ;
1455
1455
const strictFlag = dep . originModule . buildMeta . strictHarmonyModule
@@ -1466,9 +1466,11 @@ class HarmonyExportImportedSpecifierDependencyConcatenatedTemplate {
1466
1466
} _${ exportData } ${ strictFlag } __`;
1467
1467
}
1468
1468
const exportsName = this . rootModule . exportsArgument ;
1469
- const content = `/* concated harmony reexport */__webpack_require__.d(${ exportsName } , ${ JSON . stringify (
1470
- used
1471
- ) } , function() { return ${ finalName } ; });\n`;
1469
+ const content =
1470
+ `/* concated harmony reexport ${ def . name } */` +
1471
+ `__webpack_require__.d(${ exportsName } , ` +
1472
+ `${ JSON . stringify ( used ) } , ` +
1473
+ `function() { return ${ finalName } ; });\n` ;
1472
1474
source . insert ( - 1 , content ) ;
1473
1475
}
1474
1476
} else {
Original file line number Diff line number Diff line change
1
+ export var a = 1 ;
2
+
3
+ var value = 42 ;
4
+
5
+ export { value } ;
Original file line number Diff line number Diff line change
1
+ import { value } from "./module" ;
2
+
3
+ it ( "should export the correct value" , ( ) => {
4
+ expect ( value ) . toBe ( 42 ) ;
5
+ } ) ;
6
+
7
+ // prevent scope hoisting
8
+ if ( Math . random ( ) < - 1 ) {
9
+ console . log ( module . id ) ;
10
+ }
Original file line number Diff line number Diff line change
1
+ export * from "./export" ;
You can’t perform that action at this time.
0 commit comments