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

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

Issue 2163093003: [DevTools] Remove Object.values and Object.isEmpty from utilities.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 24 matching lines...) Expand all
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698