File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -428,22 +428,24 @@ class IotjsDebugSession extends DebugSession {
428
428
// General helper functions
429
429
430
430
private handleSource ( data : JerryMessageScriptParsed ) : void {
431
- const path = Path . join ( `${ this . _args . localRoot } ` , `${ this . pathToBasename ( data . name ) } ` ) ;
432
431
const src = this . _protocolhandler . getSource ( data . id ) ;
432
+ if ( src !== '' ) {
433
+ const path = Path . join ( `${ this . _args . localRoot } ` , `${ this . pathToBasename ( data . name ) } ` ) ;
433
434
434
- const write = c => Fs . writeSync ( Fs . openSync ( path , 'w' ) , c ) ;
435
+ const write = c => Fs . writeSync ( Fs . openSync ( path , 'w' ) , c ) ;
435
436
436
- if ( Fs . existsSync ( path ) ) {
437
- const content = Fs . readFileSync ( path , {
438
- encoding : 'utf8' ,
439
- flag : 'r'
440
- } ) ;
437
+ if ( Fs . existsSync ( path ) ) {
438
+ const content = Fs . readFileSync ( path , {
439
+ encoding : 'utf8' ,
440
+ flag : 'r'
441
+ } ) ;
441
442
442
- if ( content !== src ) {
443
+ if ( content !== src ) {
444
+ write ( src ) ;
445
+ }
446
+ } else {
443
447
write ( src ) ;
444
448
}
445
- } else {
446
- write ( src ) ;
447
449
}
448
450
}
449
451
You can’t perform that action at this time.
0 commit comments