|
| 1 | +import _cloneDeep from 'lodash/cloneDeep'; |
| 2 | + |
1 | 3 | module.exports = { |
2 | 4 | getBlocks() { |
3 | 5 | return { |
@@ -160,7 +162,7 @@ module.exports = { |
160 | 162 | const [funcId, idx] = variableId.split('_'); |
161 | 163 | const func = Entry.variableContainer.getFunction(funcId, idx); |
162 | 164 |
|
163 | | - func.setValue(value, variableId); |
| 165 | + func.setValue(value, variableId, script.executor.localVariables); |
164 | 166 |
|
165 | 167 | return script.callReturn(); |
166 | 168 | }, |
@@ -258,7 +260,7 @@ module.exports = { |
258 | 260 | const variableId = script.getField('VARIABLE', script); |
259 | 261 | const [funcId] = variableId.split('_'); |
260 | 262 | const func = Entry.variableContainer.getFunction(funcId); |
261 | | - return func.getValue(variableId); |
| 263 | + return func.getValue(variableId, script.executor.localVariables); |
262 | 264 | }, |
263 | 265 | syntax: { |
264 | 266 | js: [], |
@@ -380,6 +382,8 @@ module.exports = { |
380 | 382 | this.funcExecutor.register.paramMap = func.paramMap; |
381 | 383 | this.funcExecutor.parentExecutor = this.executor; |
382 | 384 | this.funcExecutor.isFuncExecutor = true; |
| 385 | + this.funcExecutor.localVariables = _cloneDeep(func.localVariables); |
| 386 | + func.funcExecutor = this.funcExecutor; |
383 | 387 | } |
384 | 388 |
|
385 | 389 | const { promises } = this.funcExecutor.execute(); |
@@ -450,6 +454,8 @@ module.exports = { |
450 | 454 | this.funcExecutor.register.paramMap = func.paramMap; |
451 | 455 | this.funcExecutor.parentExecutor = this.executor; |
452 | 456 | this.funcExecutor.isFuncExecutor = true; |
| 457 | + this.funcExecutor.localVariables = _cloneDeep(func.localVariables); |
| 458 | + func.funcExecutor = this.funcExecutor; |
453 | 459 | } |
454 | 460 |
|
455 | 461 | const { promises } = this.funcExecutor.execute(); |
|
0 commit comments