Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent TemplateProcessor context from overwritting #41

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

zhirafovod
Copy link
Member

Description

This bug was blocking using a custom TemplateProcessor with a context from StatedREPL. I.e.

const tp = new TemplateProcessor(template, {...TemplateProcessor.DEFAULT_FUNCTIONS, ...StatedWorkflow.FUNCTIONS});
const repl = new StatedREPL(tp);

Adds a test to validate the fix.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@zhirafovod zhirafovod requested a review from a team as a code owner January 22, 2024 18:50
@@ -127,7 +127,7 @@ export default class CliCore {
} else { // if we are re-initializing, we need to reset the tagSet and options, if provided
this.templateProcessor.tagSet = new Set();
this.templateProcessor.options = options;
if (contextData) {
if (contextData && Object.keys(contextData).length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no biggie, but by the code, contextData appears it would never be undefined since it defaults to {} when no contextFilePath

@geoffhendrey geoffhendrey merged commit b93f8fe into main Jan 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants