Chromium Code Reviews| Index: Source/devtools/front_end/documentation/DocumentationURLProvider.js |
| diff --git a/Source/devtools/front_end/documentation/DocumentationURLProvider.js b/Source/devtools/front_end/documentation/DocumentationURLProvider.js |
| index 239ea445e388ed7b245d6e2036919b4bffda8393..6dff0038edcbfe0689a3303d19438c89d0f86b68 100644 |
| --- a/Source/devtools/front_end/documentation/DocumentationURLProvider.js |
| +++ b/Source/devtools/front_end/documentation/DocumentationURLProvider.js |
| @@ -162,8 +162,10 @@ WebInspector.DocumentationURLProvider.prototype = { |
| */ |
| itemDescriptors: function(searchTerm) |
| { |
| - if (this._state === WebInspector.DocumentationURLProvider.DownloadStates.Finished) |
| - return this._articleList.get(searchTerm) || []; |
| + if (this._state === WebInspector.DocumentationURLProvider.DownloadStates.Finished) { |
| + if (searchTerm.toUpperCase() !== searchTerm) |
| + return this._articleList.get(searchTerm) || []; |
| + } |
| // If download of available articles list is not finished yet, use approximate method. |
| if (this._state === WebInspector.DocumentationURLProvider.DownloadStates.NotStarted) |
| this._loadArticleList(); |
| @@ -172,7 +174,7 @@ WebInspector.DocumentationURLProvider.prototype = { |
| var sources = WebInspector.DocumentationURLProvider._sources; |
| var propertyName = searchTerm.toUpperCase() === searchTerm ? "constants" : searchTerm; |
| for (var i = 0; i < sources.length; ++i) { |
| - if (!sources[i].source().hasOwnProperty(propertyName)) |
| + if (!sources[i].source().hasOwnProperty(searchTerm) || this._inheritedFromFunction(sources[i].source(), searchTerm)) |
| continue; |
| descriptors.push(new WebInspector.DocumentationURLProvider.ItemDescriptor(sources[i], propertyName)); |
| } |
| @@ -240,11 +242,22 @@ WebInspector.DocumentationURLProvider.prototype = { |
| var propertyName = itemPath.substring(lastSlashIndex + 1).replace(" ", "_"); |
| var sources = WebInspector.DocumentationURLProvider._sources; |
| for (var i = 0; i < sources.length; ++i) { |
| - if (sources[i].url() !== sourceName || !sources[i].source().hasOwnProperty(propertyName)) |
| + if (sources[i].url() !== sourceName || !sources[i].source().hasOwnProperty(propertyName) || this._inheritedFromFunction(sources[i].source(), propertyName)) |
| continue; |
| var descriptors = this._articleList.get(propertyName) || []; |
| descriptors.push(new WebInspector.DocumentationURLProvider.ItemDescriptor(sources[i], propertyName)); |
| this._articleList.set(propertyName, descriptors); |
| } |
| + }, |
| + |
| + /** |
| + * FIXME: object parameter is not annotated property due to crbug.com/407097 |
|
apavlov
2014/09/05 11:32:14
Typo: property->properly
semeny
2014/09/05 13:30:19
Done.
|
| + * @param {*} object |
| + * @param {string} propertyName |
| + * @return {boolean} |
| + */ |
| + _inheritedFromFunction: function(object, propertyName) |
| + { |
| + return (object instanceof Function && object.hasOwnProperty(propertyName) && Function.hasOwnProperty(propertyName)); |
| } |
| } |