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..49454c01efbad402132bb8e72a5e2104fd0636b6 100644 |
--- a/Source/devtools/front_end/documentation/DocumentationURLProvider.js |
+++ b/Source/devtools/front_end/documentation/DocumentationURLProvider.js |
@@ -74,7 +74,7 @@ WebInspector.DocumentationURLProvider.ItemDescriptor.prototype = { |
/** |
* @constructor |
- * FIXME: source parameter is not annotated property due to crbug.com/407097 |
+ * FIXME: source parameter is not annotated properly due to crbug.com/407097 |
* @param {*} source |
* @param {string} url |
* @param {string} name |
@@ -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 properly due to crbug.com/407097 |
+ * @param {*} object |
+ * @param {string} propertyName |
+ * @return {boolean} |
+ */ |
+ _inheritedFromFunction: function(object, propertyName) |
+ { |
+ return (object instanceof Function && object.hasOwnProperty(propertyName) && Function.hasOwnProperty(propertyName)); |
} |
} |