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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/platform/utilities.js

Issue 2869293002: DevTools: make CompilerScriptMapping / SASSSourceMapping manage UISourceCodes (Closed)
Patch Set: address comments Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 1085
1086 /** 1086 /**
1087 * @return {!Array.<T>} 1087 * @return {!Array.<T>}
1088 * @template T 1088 * @template T
1089 */ 1089 */
1090 Set.prototype.valuesArray = function() { 1090 Set.prototype.valuesArray = function() {
1091 return Array.from(this.values()); 1091 return Array.from(this.values());
1092 }; 1092 };
1093 1093
1094 /** 1094 /**
1095 * @return {?T}
1096 * @template T
1097 */
1098 Set.prototype.firstValue = function() {
1099 if (!this.size)
1100 return null;
1101 return this.values().next().value;
1102 };
1103
1104 /**
1095 * @param {!Iterable<T>|!Array<!T>} iterable 1105 * @param {!Iterable<T>|!Array<!T>} iterable
1096 * @template T 1106 * @template T
1097 */ 1107 */
1098 Set.prototype.addAll = function(iterable) { 1108 Set.prototype.addAll = function(iterable) {
1099 for (var e of iterable) 1109 for (var e of iterable)
1100 this.add(e); 1110 this.add(e);
1101 }; 1111 };
1102 1112
1103 /** 1113 /**
1104 * @param {!Iterable<T>|!Array<!T>} iterable 1114 * @param {!Iterable<T>|!Array<!T>} iterable
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1452 * @param {function(new:T, ...)} constructorFunction 1462 * @param {function(new:T, ...)} constructorFunction
1453 * @return {!T} 1463 * @return {!T}
1454 */ 1464 */
1455 function singleton(constructorFunction) { 1465 function singleton(constructorFunction) {
1456 if (_singletonSymbol in constructorFunction) 1466 if (_singletonSymbol in constructorFunction)
1457 return constructorFunction[_singletonSymbol]; 1467 return constructorFunction[_singletonSymbol];
1458 var instance = new constructorFunction(); 1468 var instance = new constructorFunction();
1459 constructorFunction[_singletonSymbol] = instance; 1469 constructorFunction[_singletonSymbol] = instance;
1460 return instance; 1470 return instance;
1461 } 1471 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698