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

Side by Side Diff: Tools/GardeningServer/scripts/base.js

Issue 362453003: Remove dead code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Tools/GardeningServer/scripts/base_unittests.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 var result = {}; 85 var result = {};
86 86
87 for (var key in dictionary) { 87 for (var key in dictionary) {
88 if (predicate(key)) 88 if (predicate(key))
89 result[key] = dictionary[key]; 89 result[key] = dictionary[key];
90 } 90 }
91 91
92 return result; 92 return result;
93 }; 93 };
94 94
95 base.mapDictionary = function(dictionary, functor)
96 {
97 var result = {};
98
99 for (var key in dictionary) {
100 var value = functor(dictionary[key]);
101 if (typeof value !== 'undefined')
102 result[key] = value;
103 }
104
105 return result;
106 };
107
108 base.filterTree = function(tree, isLeaf, predicate) 95 base.filterTree = function(tree, isLeaf, predicate)
109 { 96 {
110 var filteredTree = {}; 97 var filteredTree = {};
111 98
112 function walkSubtree(subtree, directory) 99 function walkSubtree(subtree, directory)
113 { 100 {
114 for (var childName in subtree) { 101 for (var childName in subtree) {
115 var child = subtree[childName]; 102 var child = subtree[childName];
116 var childPath = base.joinPath(directory, childName); 103 var childPath = base.joinPath(directory, childName);
117 if (isLeaf(child)) { 104 if (isLeaf(child)) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 return null; 255 return null;
269 return decodeURI(match[1]) 256 return decodeURI(match[1])
270 } 257 }
271 258
272 base.underscoredBuilderName = function(builderName) 259 base.underscoredBuilderName = function(builderName)
273 { 260 {
274 return builderName.replace(/[ .()]/g, '_'); 261 return builderName.replace(/[ .()]/g, '_');
275 } 262 }
276 263
277 })(); 264 })();
OLDNEW
« no previous file with comments | « no previous file | Tools/GardeningServer/scripts/base_unittests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698