at should throw if the key is missing
mhagmajer opened this issue · 7 comments
mhagmajer commented
ask {
const marta = { firstName: 'Marta' }
marta:at('firstName3')
}
returns null
(empty) but an error was expected (playground with AskVM v. 1.2.0)
mhagmajer commented
@czerwinskilukasz1 what's your opinion about this?
mhagmajer commented
I'd really like not to have two empty values like in JavaScript
czerwinskilukasz1 commented
I'm fine with throwing as soon as we have hasKey
: #400
czerwinskilukasz1 commented
hasKey
is implemented, this is unblocked now.
mhagmajer commented
Place to fix that in code: https://github.com/xFAANG/askql/blob/master/src/askvm/resources/core/at.ts
dastin-sandura commented
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 😄
Next, I will work on changing the implementation of at to work as expected by the test
dastin-sandura commented
My pull request is ready for review 😃