This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Oddity with optional chaining #715
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
Steps to Reproduce
- Add this code to the editor:
iterateJsdoc(() => {
const checkNativeTypes = () => {
for (const strictNativeType of strictNativeTypes) {
if (
!preferredTypes?.[typeNodeName]
) {
continue;
}
}
return changedPreferred;
};
}, {
meta: {},
});
- Click to the end of the line with the
for
- Use the bracket matcher command (ctrl-m by default)
Expected behavior:
The cursor should go to the end of the for
tloop
Actual behavior:
It goes to the beginning of the document in safe mode (but to the end of the document otherwise for some reason), neither of which is expected.
Reproduces how often:
100%.
Versions
Atom : 1.60.0
Electron: 9.4.4
Chrome : 83.0.4103.122
Node : 12.14.1
apm 2.6.2
npm 6.14.13
node 12.14.1 x64
atom 1.60.0
python 3.9.7
git 2.32.0
OS: Mac OS 12.3.
Additional Information
Changing the return
line to return true
gives yet another wrong behavior.
If I get rid of the optional chaining or put the parentheses on the same line, or get rid of the meta
object, it works as expected.
Metadata
Metadata
Assignees
Labels
No labels
Activity