Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Oddity with optional chaining #715

Open
1 task done
brettz9 opened this issue Mar 25, 2022 · 0 comments · Fixed by pulsar-edit/pulsar#79 · May be fixed by #686
Open
1 task done

Oddity with optional chaining #715

brettz9 opened this issue Mar 25, 2022 · 0 comments · Fixed by pulsar-edit/pulsar#79 · May be fixed by #686

Comments

@brettz9
Copy link

brettz9 commented Mar 25, 2022

Prerequisites

Description

Steps to Reproduce

  1. Add this code to the editor:
iterateJsdoc(() => {
  const checkNativeTypes = () => {
    for (const strictNativeType of strictNativeTypes) {
      if (
        !preferredTypes?.[typeNodeName]
      ) {
        continue;
      }
    }

    return changedPreferred;
  };
}, {
  meta: {},
});
  1. Click to the end of the line with the for
  2. 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.

@icecream17 icecream17 linked a pull request Mar 25, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant