Chromium Code Reviews| Index: res/js/common.js |
| diff --git a/res/js/common.js b/res/js/common.js |
| index 8f1fc8f705a5ecdd3f62886d7550d38121c0c406..fd4d2ebc1dd9ef7ca7bf1f415a7f4fe778f25138 100644 |
| --- a/res/js/common.js |
| +++ b/res/js/common.js |
| @@ -583,5 +583,12 @@ this.sk = this.sk || function() { |
| }); |
| } |
| + // 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
|
| + if (typeof String.prototype.startsWith != 'function') { |
| + String.prototype.startsWith = function (str){ |
| + return this.slice(0, str.length) == str; |
| + }; |
| + } |
| + |
| return sk; |
| }(); |