Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Fix bug #1109 (Quick Open JS: can't access second function with same name) #1710

Merged
merged 1 commit into from
Oct 1, 2012

Conversation

peterflynn
Copy link
Member

Fix bug #1109 (Quick Open JS: can't access second function with same name), and equivalent bug for CSS & HTML Quick Open. Simplifies logic at the same time, taking advantage of #1565.

Plus two tiny docs fixes.

…name)

and equivalent bug for CSS & HTML Quick Open. Simplifies logic as well.

Plus two tiny docs fixes.
@ghost ghost assigned redmunds Sep 27, 2012
}
var selectorInfo = selectedItem.selectorInfo;

var from = {line: selectorInfo.selectorStartLine, ch: selectorInfo.selectorStartChar};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code checked for "if (selectorInfo)" before dereferencing it. Are you really sure that it will always be defined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@redmunds:
I think we can be sure: in search(), selectorInfo is set on every searchResult that's returned. The value it's set to (itemInfo) is guaranteed to be non-null by line 75 where it's dereferenced (although also it should be safe to assume that the input list before filtering doesn't contain null entries). Same is true in the HTML & JS versions of this code.

In the old code that was using the slightly fragile getLocationFrom*() utils to map back from the DOM node to a search result item, it sort of made sense to be worried that something could go wrong and give you null. Now I think we can safely assume it's always non-null.

@redmunds
Copy link
Contributor

Done with initial review.

@peterflynn
Copy link
Member Author

Thanks for the 'bonus' code review btw!

redmunds added a commit that referenced this pull request Oct 1, 2012
Fix bug #1109 (Quick Open JS: can't access second function with same name)
@redmunds redmunds merged commit 119e1c1 into master Oct 1, 2012
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 this pull request may close these issues.

2 participants