Replies: 1 comment 1 reply
-
Because evaluating the second operand would be against the spec (and generally anything expected) this would be quite hard to achieve. You could parse the script with esprima and then visit the nodes trying to find invalid identifiers if you know they are invalid. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, all!
I'm interested in learning how I might detect syntax errors within various expressions passed into Jint 3.0. Specifically, I'm encountering cases where syntax errors related to undefined variables aren't being flagged due to short-circuiting behavior.
As an example, passing in the following expression evaluates to 'false':
false && my_bad_variable
Short-circuiting detects the first
false
and determines that further evaluation is not necessary.While this is a valid and expected behavior, it would be helpful under certain conditions to detect the undefined variable and receive an exception like:
my_bad_variable is not defined
I would be grateful for any direction you can provide.
Beta Was this translation helpful? Give feedback.
All reactions