diff options
Diffstat (limited to 'src/scripttools/debugging/scripts/commands/return.qs')
-rw-r--r-- | src/scripttools/debugging/scripts/commands/return.qs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/scripttools/debugging/scripts/commands/return.qs b/src/scripttools/debugging/scripts/commands/return.qs new file mode 100644 index 0000000..372c818 --- /dev/null +++ b/src/scripttools/debugging/scripts/commands/return.qs @@ -0,0 +1,20 @@ +name = "return"; + +group = "running"; + +shortDescription = "Make selected stack frame return to its caller"; + +longDescription = ""; + +argumentTypes = [ "script" ]; + +function execute() { + // TODO: + // 1. schedule evaluate of the expression. + // 2. install event handler/filter, so that we're notified when the evaluate is done. + // - what if another event occurs while we evaluate? (e.g. an exception or breakpoint) + // - the event filter needs to uninstall itself, or the event needs to be consumed internally + // 3. in the event handler, schedule forced return with the result as argument. + setEvaluateAction(1); + scheduleEvaluate(getCurrentFrameIndex(), arguments[0], "console input (" + Date() + ")"); +}; |