EricSmekens / jsep

JavaScript Expression Parser
http://ericsmekens.github.io/jsep/
MIT License
835 stars 136 forks source link

Infinity should be Literal value not Identifier #255

Closed atiquefiroz closed 15 hours ago

atiquefiroz commented 1 year ago

Hi Team,

Recently i had a use-case where in expression i was handling the division by 0 use case. When i was parsing the expression the Infinity as a comparison literal was coming out to be Identifier.

Can we add this as well in Literal or non Identifier list?

Thanks Atique Firoz

6utt3rfly commented 1 year ago

Hi @atiquefiroz ! I looked through some of the history and only found issue #101 ... I agree that it's strange that there are some predefined values but not others (like undefined, Infinity, NaN). For now, you can also use the addLiteral(), removeLiteral(), and removeAllLiterals to define your desired preset

github-actions[bot] commented 15 hours ago

:tada: This issue has been resolved in version 1.4.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 15 hours ago

:tada: This issue has been resolved in version @jsep-plugin/arrow-v1.0.6 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 15 hours ago

:tada: This issue has been resolved in version @jsep-plugin/assignment-v1.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 15 hours ago

:tada: This issue has been resolved in version @jsep-plugin/async-await-v1.0.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 15 hours ago

:tada: This issue has been resolved in version @jsep-plugin/comment-v1.0.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 15 hours ago

:tada: This issue has been resolved in version @jsep-plugin/new-v1.0.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 15 hours ago

:tada: This issue has been resolved in version @jsep-plugin/numbers-v1.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 15 hours ago

:tada: This issue has been resolved in version @jsep-plugin/object-v1.2.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 15 hours ago

:tada: This issue has been resolved in version @jsep-plugin/template-v1.0.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: