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

Fixed arguments error reporting #1066

Merged
merged 1 commit into from
Jun 27, 2024
Merged

Conversation

floriancargoet
Copy link
Contributor

Checklist

  • The new code additions passed the tests (npm test).
  • The linter ran and found no issues (npm run-script lint).
    (there were pre-existing warnings)

Description

PassArgumentsToEvaluationStack checks that arguments are valid and reports an error if not.
There are two bugs in this function:

  • the arguments to validate are in the args variable but this function incorrectly uses the special arguments keyword instead in two places in the error reporting section
  • the ternary operator is incorrectly parenthesised, causing the thrown error to always be new Error("null")

I've added two tests to check that an invalid parameter passed to a function or a knot/stitch is correctly reported.

@smwhr smwhr merged commit 37cc001 into y-lohse:master Jun 27, 2024
1 check passed
@floriancargoet floriancargoet deleted the patch-2 branch June 27, 2024 11:46
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