-
-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional chaining #2221
Optional chaining #2221
Conversation
This is wished for here: #1302 (comment) |
if (functionName) | ||
jsiConsolePrintf("Stepping into %v\n", functionName); | ||
else | ||
jsiConsolePrintf("Stepping into function\n", functionName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed these spaces got replaced with tabs. Please can you try and tweak these (and change your editor so tabs don't get added?). It really screws up the layout if someone views the code and doesn't have 8 space tabs set
@@ -1123,6 +1150,10 @@ NO_INLINE JsVar *jspeFactorMember(JsVar *a, JsVar **parentResult) { | |||
jsvUnLock(aVar); | |||
} | |||
jsvUnLock(index); | |||
|
|||
#ifndef ESPR_NO_OPTIONAL_CHAINING | |||
JSP_RESTORE_EXECUTE(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid this breaks stuff. undefined[1]
should cause an exception (like 1143) but JSP_RESTORE_EXECUTE removes the error flag, so it just quietly completes. I can imagine there might be other code you could come up with (not just errors, but return/break/etc) too
Sorry it's taken so long to look into this! But I am a bit concerned about the use of |
This adds support for the three types of optional chaining: