File tree 1 file changed +3
-4
lines changed
scripts/emulator-testing/emulators
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,6 @@ export abstract class Emulator {
40
40
this . cacheBinaryPath = path . join ( this . cacheDirectory , binaryName ) ;
41
41
}
42
42
43
- setBinaryPath ( path : string ) {
44
- this . binaryPath = path ;
45
- }
46
43
download ( ) : Promise < void > {
47
44
if ( fs . existsSync ( this . cacheBinaryPath ) ) {
48
45
console . log ( `Emulator found in cache: ${ this . cacheBinaryPath } ` ) ;
@@ -58,7 +55,9 @@ export abstract class Emulator {
58
55
const writer = fs . createWriteStream ( filepath ) ;
59
56
console . log ( `Downloading emulator from [${ this . binaryUrl } ] ...` ) ;
60
57
// Map the DOM's fetch Reader to node's streaming file system
61
- // operations.
58
+ // operations. We will need to access class members `binaryPath` and `copyToCache` after the
59
+ // download completes. It's a compilation error to pass `this` into the named function
60
+ // `readChunk`, so the download operation is wrapped in a promise that we wait upon.
62
61
const downloadPromise = new Promise < void > (
63
62
( downloadComplete , downloadFailed ) => {
64
63
fetch ( this . binaryUrl )
You can’t perform that action at this time.
0 commit comments