File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,10 +14,11 @@ class StorageDatabase implements workspaceStorage.IStorageDatabase {
1414 public readonly onDidChangeItemsExternal = Event . None ;
1515 private readonly items = new Map < string , string > ( ) ;
1616 private fetched : boolean = false ;
17+ private readonly path : string ;
1718
18- public constructor ( private readonly path : string ) {
19- path = path . replace ( / \. v s c d b $ / , ".json" ) ;
20- logger . debug ( "Setting up storage" , field ( "path" , path ) ) ;
19+ public constructor ( path : string ) {
20+ this . path = path . replace ( / \. v s c d b $ / , ".json" ) ;
21+ logger . debug ( "Setting up storage" , field ( "path" , this . path ) ) ;
2122 window . addEventListener ( "unload" , ( ) => {
2223 if ( ! navigator . sendBeacon ) {
2324 throw new Error ( "cannot save state" ) ;
@@ -39,7 +40,7 @@ class StorageDatabase implements workspaceStorage.IStorageDatabase {
3940 this . items . set ( key , json [ key ] ) ;
4041 } ) ;
4142 } catch ( error ) {
42- if ( error . code && error . code !== "ENOENT" ) {
43+ if ( error . code !== "ENOENT" ) {
4344 throw error ;
4445 }
4546 }
You can’t perform that action at this time.
0 commit comments