-
Notifications
You must be signed in to change notification settings - Fork 29
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
at should throw if the key is missing #404
Comments
@czerwinskilukasz1 what's your opinion about this? |
I'd really like not to have two empty values like in JavaScript |
I'm fine with throwing as soon as we have |
|
Place to fix that in code: https://github.com/xFAANG/askql/blob/master/src/askvm/resources/core/at.ts |
I have created a pull request (https://github.com/xFAANG/askql/pull/523/files) with a unit test for this case. I will appreciate if someone could verify if the test is correct 😄 |
My pull request is ready for review 😃 |
- test case for regular access of a list and object using 'at' - implementation of flow which detects our of bound error when using 'at' to access a lists element by its index
- att test case and implementation to handle a case for accessing a negative index of a list
* unit test for case when using at to access property not defined before * mend * change message in the thrown error to match the unit test * throw error only if accessing a non existing property of a non-null object * tests for case when using list, implementation of throwing error when index is out of bounds * issue #404 - test case for regular access of a list and object using 'at' - implementation of flow which detects our of bound error when using 'at' to access a lists element by its index * issue #404 - att test case and implementation to handle a case for accessing a negative index of a list * use template literals to format the error message more clearly Co-authored-by: Dastin.Sandura <dastin.sandura@gft.com>
…hTheTornado#523) * unit test for case when using at to access property not defined before * mend * change message in the thrown error to match the unit test * throw error only if accessing a non existing property of a non-null object * tests for case when using list, implementation of throwing error when index is out of bounds * issue CatchTheTornado#404 - test case for regular access of a list and object using 'at' - implementation of flow which detects our of bound error when using 'at' to access a lists element by its index * issue CatchTheTornado#404 - att test case and implementation to handle a case for accessing a negative index of a list * use template literals to format the error message more clearly Co-authored-by: Dastin.Sandura <dastin.sandura@gft.com>
returns
null
(empty) but an error was expected (playground with AskVM v. 1.2.0)The text was updated successfully, but these errors were encountered: