Skip to content

Commit

Permalink
complements LinqLover/SimulationStudio@d5b898b (fix #runSimulated:con…
Browse files Browse the repository at this point in the history
…textAtEachStep: for non-local returns to complement trunk updates)
  • Loading branch information
LinqLover committed Dec 27, 2023
1 parent 7c7d4d4 commit bca4c3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ context: aContext runSimulated: aBlock contextAtEachStep: anotherBlock do: simul
ensure := thisContext sender.
result := (ensure selector
caseOf:
{[#resume:through:] -> [ensure at: 1 "value"].
{"[#resume:through:] -> [ensure at: 1 ""value""]." "goold old eem 4/25/2012 10:48, no longer in use"
[#resumeEvaluating:] ->
[| resumeBlock |
resumeBlock := ensure at: 1 "aBlock".
self assert: resumeBlock outerContext selector == #resume:. "other sender #returnEvaluating: is only sent to signaler contexts"
resumeBlock value]}
otherwise: [(ensure "BlockClosure >> #ensure: or BlockClosure >> #ifCurtailed:" at: 3) "returnValue"]).
otherwise: [:selector |
| outer |
(selector == #ensure: and: [(outer := (ensure at: 1) outerContext) method == (Context >> #runUntilReturnFrom:)])
ifTrue: [(outer sender sender at: 1) at: 1]
ifFalse: [(ensure "BlockClosure >> #ensure: or BlockClosure >> #ifCurtailed:" at: 3) "returnValue"]]).

"Record result."
results ifNotNil:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"context:pushReceiverVariable:do:" : "ct 7/21/2022 15:04",
"context:return:from:do:" : "ct 7/31/2022 21:23",
"context:runPrimitive:method:receiver:args:" : "ct 6/1/2022 11:57",
"context:runSimulated:contextAtEachStep:do:" : "ct 7/31/2022 21:21",
"context:runSimulated:contextAtEachStep:do:" : "ct 12/27/2023 03:15",
"context:send:super:numArgs:do:" : "ct 6/2/2022 10:41",
"context:send:to:with:do:" : "ct 7/5/2022 12:28",
"context:sendSpecial:numArgs:do:" : "ct 5/28/2022 22:42",
Expand Down

0 comments on commit bca4c3c

Please sign in to comment.