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

Bug: 0 value arguments are removed? #492

Merged
merged 1 commit into from Oct 8, 2021
Merged

Conversation

krisbitney
Copy link
Contributor

@krisbitney krisbitney commented Sep 30, 2021

This PR prevents erasure of falsy variable values by changing a validation check from:

if (!variables[node.name.value]) {
        throw Error(`Missing variable: ${node.name.value}`);
      }

to:

if (variables[node.name.value] === undefined) {
        throw Error(`Missing variable: ${node.name.value}`);
      }

The PR also adds a unit test to confirm the parse-query algorithm does not throw when variable value is falsy.

Closes #485.

@krisbitney krisbitney changed the title Bug: 0 value arguments are removed? Bug fix: 0 value arguments are removed? Sep 30, 2021
@krisbitney krisbitney changed the title Bug fix: 0 value arguments are removed? Fix: 0 value arguments are removed? Sep 30, 2021
@krisbitney krisbitney changed the title Fix: 0 value arguments are removed? Bug: 0 value arguments are removed? Sep 30, 2021
@dOrgJelli dOrgJelli merged commit cb91a1c into prealpha-dev Oct 8, 2021
@dOrgJelli dOrgJelli deleted the 0-value-args branch January 16, 2022 18:35
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