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

Improve std.get and error messages #223

Merged
merged 1 commit into from
Dec 6, 2024
Merged

Improve std.get and error messages #223

merged 1 commit into from
Dec 6, 2024

Conversation

stephenamar-db
Copy link
Collaborator

@stephenamar-db stephenamar-db commented Dec 5, 2024

This PR does 2 things:

It improves std.get() to only compute default when it's needed.

and it makes builtin error more readable
Before

bazel-bin/bazel/jsonnet/sjsonnet.jar -e 'std.get(["a", "b"], "a", null)'
sjsonnet.Error: Wrong parameter type: expected Object, got array
    at [ApplyBuiltin].(<exec>:1:8)

after

bazel-bin/bazel/jsonnet/sjsonnet.jar -e 'std.get(["a", "b"], "a", null)'
sjsonnet.Error: Wrong parameter type: expected Object, got array
    at [std.get].(<exec>:1:8)

@stephenamar-db stephenamar-db force-pushed the tailrec branch 2 times, most recently from b46e995 to 558888e Compare December 5, 2024 23:46
@stephenamar-db stephenamar-db force-pushed the tailrec branch 5 times, most recently from dff0188 to a3fcfdb Compare December 6, 2024 17:25
@stephenamar-db stephenamar-db merged commit 0f9f9b4 into master Dec 6, 2024
1 check passed
@stephenamar-db stephenamar-db deleted the tailrec branch December 6, 2024 17:38
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