File tree 2 files changed +11
-8
lines changed
2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,9 @@ class Variable {
33
33
}
34
34
}
35
35
36
- toXML ( ) {
37
- return `<variable type="${ this . type } " id="${ this . id } ">${ this . name } </variable>` ;
36
+ toXML ( isLocal ) {
37
+ isLocal = ( isLocal === true ) ;
38
+ return `<variable type="${ this . type } " id="${ this . id } " islocal="${ isLocal } ">${ this . name } </variable>` ;
38
39
}
39
40
40
41
/**
Original file line number Diff line number Diff line change @@ -1074,19 +1074,21 @@ class VirtualMachine extends EventEmitter {
1074
1074
const id = messageIds [ i ] ;
1075
1075
delete this . runtime . getTargetForStage ( ) . variables [ id ] ;
1076
1076
}
1077
- const variableMap = Object . assign ( { } ,
1078
- this . runtime . getTargetForStage ( ) . variables ,
1079
- this . editingTarget . variables
1080
- ) ;
1077
+ const globalVarMap = Object . assign ( { } , this . runtime . getTargetForStage ( ) . variables ) ;
1078
+ const localVarMap = this . editingTarget . isStage ?
1079
+ Object . create ( null ) :
1080
+ Object . assign ( { } , this . editingTarget . variables ) ;
1081
1081
1082
- const variables = Object . keys ( variableMap ) . map ( k => variableMap [ k ] ) ;
1082
+ const globalVariables = Object . keys ( globalVarMap ) . map ( k => globalVarMap [ k ] ) ;
1083
+ const localVariables = Object . keys ( localVarMap ) . map ( k => localVarMap [ k ] ) ;
1083
1084
const workspaceComments = Object . keys ( this . editingTarget . comments )
1084
1085
. map ( k => this . editingTarget . comments [ k ] )
1085
1086
. filter ( c => c . blockId === null ) ;
1086
1087
1087
1088
const xmlString = `<xml xmlns="http://www.w3.org/1999/xhtml">
1088
1089
<variables>
1089
- ${ variables . map ( v => v . toXML ( ) ) . join ( ) }
1090
+ ${ globalVariables . map ( v => v . toXML ( ) ) . join ( ) }
1091
+ ${ localVariables . map ( v => v . toXML ( true ) ) . join ( ) }
1090
1092
</variables>
1091
1093
${ workspaceComments . map ( c => c . toXML ( ) ) . join ( ) }
1092
1094
${ this . editingTarget . blocks . toXML ( this . editingTarget . comments ) }
You can’t perform that action at this time.
0 commit comments