This repository was archived by the owner on Jul 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -687,13 +687,18 @@ function logloads(loads) {
687687 // NB This should be an Object.defineProperty, but that is very slow.
688688 // By disaling this module write-protection we gain performance.
689689 // It could be useful to allow an option to enable or disable this.
690+ module . locked = true ;
690691 moduleObj [ name ] = value ;
691692
692693 for ( var i = 0 , l = module . importers . length ; i < l ; i ++ ) {
693694 var importerModule = module . importers [ i ] ;
694- var importerIndex = importerModule . dependencies . indexOf ( module ) ;
695- importerModule . setters [ importerIndex ] ( moduleObj ) ;
695+ if ( ! importerModule . locked ) {
696+ var importerIndex = importerModule . dependencies . indexOf ( module ) ;
697+ importerModule . setters [ importerIndex ] ( moduleObj ) ;
698+ }
696699 }
700+
701+ module . locked = false ;
697702 return value ;
698703 } ) ;
699704
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import {fn2, variable2} from './circular2';
22
33export var variable1 = 'test circular 1' ;
44
5+ export { output as output2 } from './circular2' ;
6+
57fn2 ( ) ;
68
79export var output ;
Original file line number Diff line number Diff line change @@ -212,7 +212,8 @@ function runTests() {
212212 assert (
213213 [ m2 . output , 'test circular 1' ] ,
214214 [ m1 . output , 'test circular 2' ] ,
215- [ m2 . output1 , 'test circular 2' ]
215+ [ m2 . output1 , 'test circular 2' ] ,
216+ [ m1 . output2 , 'test circular 1' ]
216217 ) ;
217218 } , err ) ;
218219 } , err ) ;
You can’t perform that action at this time.
0 commit comments