EricSmekens / jsep

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

Fix Object/Ternary working together, Support Object member expressions #184

Closed 6utt3rfly closed 3 years ago

6utt3rfly commented 3 years ago

The object plugin adds a : binary operator which interferes with ternaries. The previous version would work with both objects and ternaries, but not when nested without parentheses. Fixes cases like, a ? 0 : b ? 1 : 2 and similar.

Fixes #183

Also add support for Object member expressions. Was initially overlooked, but was easy to add with the existing gobbleTokenProperty() method

github-actions[bot] commented 3 years ago

:tada: This PR is included in version @jsep-plugin/object-v1.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 3 years ago

:tada: This PR is included in version @jsep-plugin/ternary-v1.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

6utt3rfly commented 3 years ago

@EricSmekens - the initial build failed because it was expecting tags in the format @jsep-plugin/xxx-v#.#.# but they were named without the v. I pushed new tags (aliases of the previous tags) so that the subsequent build worked correctly, but I didn't delete the old tags. Feel free to delete them if you want?