-
Notifications
You must be signed in to change notification settings - Fork 448
Conversation
In commit c6fa259, "var" usage was replaced with const. The code previously worked because "var" has function scoping unlike const which has block scoping. TypeError: Cannot read property 'attributes' of null
The backtrace we got is
|
I wonder if there are more cases of variable shadowing gone wrong. We should add a rule to the linter to prevent this. |
This is what I was afraid of in #674. |
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 really want to ask for test coverage here to prevent a regression, but I'm unclear how feasible that would be.
I did a search with eslint and only found this shadowing to be a problem. I would prefer to move to eslint and use eslint-config-standard instead of using standard so we can add the no-shadow rule. During that search I also found that the callback on node-ldapjs/lib/persistent_search.js Lines 80 to 96 in da358a8
|
🤔 the point of using
I don't know if it is, but I'd just leave it. One day someone will work up the constitution to clean this whole mess up and these things will get resolved. |
Please include a minimal reproducible example |
In commit c6fa259, "var" usage
was replaced with const. The code previously worked because "var"
has function scoping unlike const which has block scoping.
TypeError: Cannot read property 'attributes' of null