Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1752)

Unified Diff: Source/devtools/front_end/documentation/DocumentationURLProvider.js

Issue 525363003: DevTools: [Documentation] Add signature section for renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@iliia-patch
Patch Set: Rebased on current patch Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/documentation/DocumentationView.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2387a4d3e8cf322969fbf90cc3d00fb539e09c58..ac45a4e65bd0138bb39235dfe2dd904cb3bfeaef 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
@@ -172,7 +172,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));
}
@@ -233,19 +233,29 @@ WebInspector.DocumentationURLProvider.prototype = {
var lastSlashIndex = itemPath.lastIndexOf("/");
if (lastSlashIndex === -1)
return;
+ var sourceName = itemPath.substring(0, lastSlashIndex + 1);
// There are some properties which have several words in their name.
// In article list they are written through gap, while in URL they are written through underscore.
// We are creating URL for current property, so we have to replace all the gaps with underscores.
- var correctedItemPath = itemPath.replace(" ", "_");
- var sourceName = correctedItemPath.substring(0, lastSlashIndex + 1);
- var propertyName = correctedItemPath.substring(lastSlashIndex + 1);
+ 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));
}
}
« no previous file with comments | « no previous file | Source/devtools/front_end/documentation/DocumentationView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698