| 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 24 matching lines...) Expand all Loading... |
| 35 { | 35 { |
| 36 if (value) | 36 if (value) |
| 37 return; | 37 return; |
| 38 console.__originalAssert(value, message); | 38 console.__originalAssert(value, message); |
| 39 } | 39 } |
| 40 | 40 |
| 41 /** @typedef {Array|NodeList|Arguments|{length: number}} */ | 41 /** @typedef {Array|NodeList|Arguments|{length: number}} */ |
| 42 var ArrayLike; | 42 var ArrayLike; |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * @param {!Object} obj | |
| 46 * @return {boolean} | |
| 47 */ | |
| 48 Object.isEmpty = function(obj) | |
| 49 { | |
| 50 for (var i in obj) | |
| 51 return false; | |
| 52 return true; | |
| 53 } | |
| 54 | |
| 55 /** | |
| 56 * @param {!Object.<string,!T>} obj | |
| 57 * @return {!Array.<!T>} | |
| 58 * @template T | |
| 59 */ | |
| 60 Object.values = function(obj) | |
| 61 { | |
| 62 var result = Object.keys(obj); | |
| 63 var length = result.length; | |
| 64 for (var i = 0; i < length; ++i) | |
| 65 result[i] = obj[result[i]]; | |
| 66 return result; | |
| 67 } | |
| 68 | |
| 69 /** | |
| 70 * @param {number} m | 45 * @param {number} m |
| 71 * @param {number} n | 46 * @param {number} n |
| 72 * @return {number} | 47 * @return {number} |
| 73 */ | 48 */ |
| 74 function mod(m, n) | 49 function mod(m, n) |
| 75 { | 50 { |
| 76 return ((m % n) + n) % n; | 51 return ((m % n) + n) % n; |
| 77 } | 52 } |
| 78 | 53 |
| 79 /** | 54 /** |
| (...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1570 while (rightIndex < rightKeys.length) { | 1545 while (rightIndex < rightKeys.length) { |
| 1571 var rightKey = rightKeys[rightIndex++]; | 1546 var rightKey = rightKeys[rightIndex++]; |
| 1572 added.push(other.get(rightKey)); | 1547 added.push(other.get(rightKey)); |
| 1573 } | 1548 } |
| 1574 return { | 1549 return { |
| 1575 added: added, | 1550 added: added, |
| 1576 removed: removed, | 1551 removed: removed, |
| 1577 equal: equal | 1552 equal: equal |
| 1578 } | 1553 } |
| 1579 } | 1554 } |
| OLD | NEW |