| OLD | NEW |
| 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 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1254 * @return {string} | 1254 * @return {string} |
| 1255 */ | 1255 */ |
| 1256 function numberToStringWithSpacesPadding(value, symbolsCount) | 1256 function numberToStringWithSpacesPadding(value, symbolsCount) |
| 1257 { | 1257 { |
| 1258 var numberString = value.toString(); | 1258 var numberString = value.toString(); |
| 1259 var paddingLength = Math.max(0, symbolsCount - numberString.length); | 1259 var paddingLength = Math.max(0, symbolsCount - numberString.length); |
| 1260 return spacesPadding(paddingLength) + numberString; | 1260 return spacesPadding(paddingLength) + numberString; |
| 1261 } | 1261 } |
| 1262 | 1262 |
| 1263 /** | 1263 /** |
| 1264 * @param {!Iterator.<T>} iterator | |
| 1265 * @return {!Array.<T>} | |
| 1266 * @template T | |
| 1267 */ | |
| 1268 Array.from = function(iterator) | |
| 1269 { | |
| 1270 var values = []; | |
| 1271 for (var iteratorValue = iterator.next(); !iteratorValue.done; iteratorValue
= iterator.next()) | |
| 1272 values.push(iteratorValue.value); | |
| 1273 return values; | |
| 1274 } | |
| 1275 | |
| 1276 /** | |
| 1277 * @return {!Array.<T>} | 1264 * @return {!Array.<T>} |
| 1278 * @template T | 1265 * @template T |
| 1279 */ | 1266 */ |
| 1280 Set.prototype.valuesArray = function() | 1267 Set.prototype.valuesArray = function() |
| 1281 { | 1268 { |
| 1282 return Array.from(this.values()); | 1269 return Array.from(this.values()); |
| 1283 } | 1270 } |
| 1284 | 1271 |
| 1285 /** | 1272 /** |
| 1286 * @param {!Iterable<T>} iterable | 1273 * @param {!Iterable<T>} iterable |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1662 _tryMerge: function(first, second) | 1649 _tryMerge: function(first, second) |
| 1663 { | 1650 { |
| 1664 var merged = this._mergeCallback && this._mergeCallback(first, second); | 1651 var merged = this._mergeCallback && this._mergeCallback(first, second); |
| 1665 if (!merged) | 1652 if (!merged) |
| 1666 return null; | 1653 return null; |
| 1667 merged.begin = first.begin; | 1654 merged.begin = first.begin; |
| 1668 merged.end = Math.max(first.end, second.end); | 1655 merged.end = Math.max(first.end, second.end); |
| 1669 return merged; | 1656 return merged; |
| 1670 } | 1657 } |
| 1671 } | 1658 } |
| OLD | NEW |