File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -78,26 +78,22 @@ retrieveFileHandlers.push(function(path) {
78
78
return fileContentsCache [ path ] ;
79
79
}
80
80
81
- var contents = null ;
82
- if ( ! fs ) {
83
- try {
81
+ var contents = '' ;
82
+ try {
83
+ if ( ! fs ) {
84
84
// Use SJAX if we are in the browser
85
85
var xhr = new XMLHttpRequest ( ) ;
86
86
xhr . open ( 'GET' , path , /** async */ false ) ;
87
87
xhr . send ( null ) ;
88
88
if ( xhr . readyState === 4 && xhr . status === 200 ) {
89
89
contents = xhr . responseText ;
90
90
}
91
- } catch ( er ) {
92
- contents = '' ;
93
- }
94
- } else if ( fs . existsSync ( path ) ) {
95
- // Otherwise, use the filesystem
96
- try {
91
+ } else if ( fs . existsSync ( path ) ) {
92
+ // Otherwise, use the filesystem
97
93
contents = fs . readFileSync ( path , 'utf8' ) ;
98
- } catch ( er ) {
99
- contents = '' ;
100
94
}
95
+ } catch ( er ) {
96
+ /* ignore any errors */
101
97
}
102
98
103
99
return fileContentsCache [ path ] = contents ;
You can’t perform that action at this time.
0 commit comments