Context object support #313
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement the Context Object
The specification talks about Context Object, but we already referred to the input as
ctx, the context. Consequently, in our code I'm referring to the ExecutionContext rather than the Context Object. It's not the greatest name, but hopefully it's different enough from our existing names to be clear.The change is relatively small - we simply use the ExecutionContext when we're evaluating a state's inputs. We don't need it anywhere else. There's a small change to the argument parser to accommodate the
$$.pathconstruction, and an extra evaluation function, but that's about it.The ExecutionContext object provides a number of read-only properties, some of which it derives from the state's execution description.