@@ -6034,4 +6034,52 @@ describe('scope hoisting', function() {
6034
6034
shouldDisableCache : false ,
6035
6035
} ) ;
6036
6036
} ) ;
6037
+
6038
+ it ( 'unmark an asset group as deferred when it becomes used' , async function ( ) {
6039
+ let testDir = path . join (
6040
+ __dirname ,
6041
+ 'integration/scope-hoisting/es6/unmarks-defer-for-assetgroup' ,
6042
+ ) ;
6043
+
6044
+ await overlayFS . mkdirp ( testDir ) ;
6045
+ await overlayFS . copyFile (
6046
+ path . join ( testDir , 'index1.js' ) ,
6047
+ path . join ( testDir , 'index.js' ) ,
6048
+ ) ;
6049
+
6050
+ let b = await bundle ( path . join ( testDir , 'index.js' ) , {
6051
+ inputFS : overlayFS ,
6052
+ outputFS : overlayFS ,
6053
+ shouldDisableCache : true ,
6054
+ } ) ;
6055
+
6056
+ await run ( b ) ;
6057
+
6058
+ await overlayFS . copyFile (
6059
+ path . join ( testDir , 'index2.js' ) ,
6060
+ path . join ( testDir , 'index.js' ) ,
6061
+ ) ;
6062
+
6063
+ b = await bundle ( path . join ( testDir , 'index.js' ) , {
6064
+ inputFS : overlayFS ,
6065
+ outputFS : overlayFS ,
6066
+ shouldDisableCache : false ,
6067
+ } ) ;
6068
+
6069
+ await run ( b ) ;
6070
+
6071
+ await overlayFS . copyFile (
6072
+ path . join ( testDir , 'index3.js' ) ,
6073
+ path . join ( testDir , 'index.js' ) ,
6074
+ ) ;
6075
+
6076
+ b = await bundle ( path . join ( testDir , 'index.js' ) , {
6077
+ inputFS : overlayFS ,
6078
+ outputFS : overlayFS ,
6079
+ shouldDisableCache : false ,
6080
+ } ) ;
6081
+
6082
+ let output = await run ( b ) ;
6083
+ assert . strictEqual ( output , 'bar foo bar' ) ;
6084
+ } ) ;
6037
6085
} ) ;
0 commit comments