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

Unified Diff: Source/devtools/front_end/utilities.js

Issue 218613013: DevTools: Decouple shortcuts from actions, introduce shortcut contexts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased patch Created 6 years, 8 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 | « Source/devtools/front_end/modules.js ('k') | Source/devtools/scripts/frontend_modules.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/utilities.js
diff --git a/Source/devtools/front_end/utilities.js b/Source/devtools/front_end/utilities.js
index 5ede3b4c07c918fee88a45917f482df083fa5fd0..8b7174cf01143a1f6073ee10306efd6e3b6aa5fb 100644
--- a/Source/devtools/front_end/utilities.js
+++ b/Source/devtools/front_end/utilities.js
@@ -1114,6 +1114,18 @@ var Set = function()
this._size = 0;
}
+/**
+ * @param {!Array.<!T>} array
+ * @return {!Set.<T>}
+ * @template T
+ */
+Set.fromArray = function(array)
+{
+ var result = new Set();
+ array.forEach(function(item) { result.add(item); });
+ return result;
+}
+
Set.prototype = {
/**
* @param {!T} item
@@ -1160,7 +1172,7 @@ Set.prototype = {
* @param {!T} item
* @return {boolean}
*/
- hasItem: function(item)
+ contains: function(item)
{
return !!this._set[item.__identifier];
},
@@ -1454,6 +1466,7 @@ var StringSet = function()
/**
* @param {!Array.<string>} array
+ * @return {!StringSet}
*/
StringSet.fromArray = function(array)
{
« no previous file with comments | « Source/devtools/front_end/modules.js ('k') | Source/devtools/scripts/frontend_modules.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698