@@ -79,13 +79,13 @@ class ScriptRunner {
79
79
/**
80
80
Run `library`, with `callData`.
81
81
82
- `compilerData ` is used if it is an interpreted script.
82
+ `getCompilerVersion ` is used if it is an interpreted script.
83
83
**/
84
- public static function run (library : LibraryRunData , compilerData : LibraryData , callData : CallData ): Void {
84
+ public static function run (library : LibraryRunData , callData : CallData , getCompilerVersion : () -> SemVer ): Void {
85
85
final type = getType (library );
86
86
87
87
final cmd = getCmd (type );
88
- final args = generateArgs (type , callData , SemVer . ofString ( compilerData . version ) );
88
+ final args = generateArgs (type , callData , getCompilerVersion );
89
89
90
90
final oldState = getState ();
91
91
@@ -122,15 +122,15 @@ class ScriptRunner {
122
122
}
123
123
}
124
124
125
- static function generateArgs (runType : RunType , callData : CallData , compilerVersion : SemVer ): Array <String > {
125
+ static function generateArgs (runType : RunType , callData : CallData , getCompilerVersion : () -> SemVer ): Array <String > {
126
126
switch runType {
127
127
case Neko (path ):
128
128
final callArgs = callData .args .copy ();
129
129
callArgs .unshift (path );
130
130
callArgs .push (callData .dir );
131
131
return callArgs ;
132
132
case Script (main , name , version , dependencies ):
133
- final isHaxe4 = SemVer .compare (compilerVersion , SemVer .ofString (' 4.0.0' )) >= 0 ;
133
+ final isHaxe4 = SemVer .compare (getCompilerVersion () , SemVer .ofString (' 4.0.0' )) >= 0 ;
134
134
final useGlobalRepo = isHaxe4 && callData .useGlobalRepo ;
135
135
136
136
final callArgs = generateScriptArgs (main , name , version , dependencies , useGlobalRepo );
0 commit comments