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

feat: allow for injected functions #10

Merged
merged 1 commit into from Jun 24, 2022
Merged

feat: allow for injected functions #10

merged 1 commit into from Jun 24, 2022

Conversation

thantos
Copy link
Collaborator

@thantos thantos commented Jun 24, 2022

Allows for the serialize function to accept Function expr or Arrow Expr and return values.

previously serialize would throw an error when a function was returned.

Comment on lines +559 to +565
const funcEntry = context.cache.get(func);
if (!funcEntry) {
throw new Error(
"Entry for this this function was not created by caller"
);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Why does moving this here change things?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They process all functions beforehand and cache the results. We are injecting a function that was not processed.

The cached entry is only used when the function is named, so I moved it to fail at the last moment. It may still fail later, but this unblocks us.

@thantos thantos merged commit 69ffe91 into main Jun 24, 2022
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.

None yet

2 participants