Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /** | 1 /** |
| 2 * common.js is a set of common functions used across all of skiaperf. | 2 * common.js is a set of common functions used across all of skiaperf. |
| 3 * | 3 * |
| 4 * Everything is scoped to 'sk' except $$ and $$$ which are global since they | 4 * Everything is scoped to 'sk' except $$ and $$$ which are global since they |
| 5 * are used so often. | 5 * are used so often. |
| 6 * | 6 * |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * $$ returns a real JS array of DOM elements that match the CSS query selector. | 10 * $$ returns a real JS array of DOM elements that match the CSS query selector. |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 576 }); | 576 }); |
| 577 } | 577 } |
| 578 | 578 |
| 579 // Capitalize each word in the string. | 579 // Capitalize each word in the string. |
| 580 String.prototype.toCapWords = function() { | 580 String.prototype.toCapWords = function() { |
| 581 return this.replace(/\b\w/g, function(firstLetter) { | 581 return this.replace(/\b\w/g, function(firstLetter) { |
| 582 return firstLetter.toUpperCase(); | 582 return firstLetter.toUpperCase(); |
| 583 }); | 583 }); |
| 584 } | 584 } |
| 585 | 585 |
| 586 // return true iff the string starts with the given prefix | |
|
jcgregorio
2015/06/01 14:39:47
What is this? It's not a function?
humper
2015/06/01 16:14:43
Not sure what you mean -- I'm just checking here t
jcgregorio
2015/06/01 16:34:15
OK, yeah, so if you are just polyfilling String.st
| |
| 587 if (typeof String.prototype.startsWith != 'function') { | |
| 588 String.prototype.startsWith = function (str){ | |
| 589 return this.slice(0, str.length) == str; | |
| 590 }; | |
| 591 } | |
| 592 | |
| 586 return sk; | 593 return sk; |
| 587 }(); | 594 }(); |
| OLD | NEW |