benmarch / spel2js

Parse Spring Expression Language in JavaScript
Other
69 stars 19 forks source link

Throw exception when use multiple safe navigation operator #5

Closed cnxtwang closed 4 years ago

cnxtwang commented 6 years ago

Hi there, very useful library, Thank you, all!

I got one problem when i use safe navigation. when i use multi ?. operators like:

"nested?.doesNotExist?.test"

will throw exception:

ContextDoesNotExistException: Attempting to look up property 'test' for an undefined context.

So is this a bug or i have some misunderstanding about safe navigation ?

benmarch commented 4 years ago

Hey @cnxtwang, sorry for the extremely late response to this, I must have missed it and I haven't actively worked on this project for a while.

I think I implemented safe navigation incorrectly. I'll take another pass at it and see if it fixes this issue.

benmarch commented 4 years ago

@cnxtwang this is fixed in 0.2.7.