You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know that I do set the debug flag to false when building the AST, but the evaluate function throws an invalid array length error when I set it to true instead.
Using this, when I execute the following XQuery if ((1, 2)) then '(^∀^●)ノシ' else '╰(‵□′)╯' I get the following error message
FORG0006: A wrong argument type was specified in a function call.
While I was expecting the error message as I would get it when treating the query as a string (pass the script to evaluateXPathToAsyncIterator instead of queryAst)
1: if ((1, 2)) then '(^∀^●)ノシ' else '╰(‵□′)╯'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2:
Error: FORG0006: A wrong argument type was specified in a function call.
at <ifThenElseExpr>:1:1 - 1:43
The text was updated successfully, but these errors were encountered:
I think we should just document that we place the query in a comment at the start of the AST (or at least we do in Fonto; just do it in FontoXPath instead). From there we can make harder assumptions it's there and print it in the error.
When we evaluate a query AST we don't get as good error messaging as with normal string queries.
I've reproduced this in the
./demo/main.ts
by changing therunNormalXPath
toI know that I do set the
debug
flag tofalse
when building the AST, but the evaluate function throws aninvalid array length
error when I set it totrue
instead.Using this, when I execute the following XQuery
if ((1, 2)) then '(^∀^●)ノシ' else '╰(‵□′)╯'
I get the following error messageWhile I was expecting the error message as I would get it when treating the query as a string (pass the
script
toevaluateXPathToAsyncIterator
instead ofqueryAst
)The text was updated successfully, but these errors were encountered: