adobe / json-formula

Query language for JSON documents
http://opensource.adobe.com/json-formula/
Apache License 2.0
19 stars 8 forks source link

misc coercion errors #98

Closed JohnBrinkman closed 10 months ago

JohnBrinkman commented 10 months ago

Miscellaneous issues:

Null to string conversion

This expression:

`[]` & `["s"]`

Should return ["s"], but instead returns ["nulls"]

subtracting json literals

`5` - `4`

Gives the error: ParserError: Invalid token (Literal): "4"

Dividing by null should be an error

100/null() returns null. But should give us: "EvaluationError: Division by zero 100/0" Similarly, other expressions coerced to zero should also fail. e.g. 100/"q"