Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/common/ParsedURL.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/common/ParsedURL.js b/third_party/WebKit/Source/devtools/front_end/common/ParsedURL.js |
| index 559c5f7c4afcb8a6a1b7f9056b7247393d79a5cf..11486eeb7f1b8d871fc0677a38e011fa67cb640e 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/common/ParsedURL.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/common/ParsedURL.js |
| @@ -303,6 +303,24 @@ WebInspector.ParsedURL.splitLineAndColumn = function(string) |
| } |
| /** |
| + * @param {string} url |
| + * @return {boolean} |
| + */ |
| +WebInspector.ParsedURL.isRelativeURL = function(url) |
| +{ |
| + var hasScheme = /^([A-Za-z][A-Za-z0-9+.-]*):\/\//.test(url); |
| + if (hasScheme) |
| + return false; |
| + var hasPort = /^[^:^\/]*:/.test(url); |
|
caseq
2016/03/16 00:50:32
I think this is wrong both on part of URL grammar.
|
| + if (hasPort) |
| + return false; |
| + var hasDomain = /^[^.^\/]*\.[^\/]*\//.test(url); |
|
caseq
2016/03/16 00:50:33
... and regexp syntax.
|
| + if (hasDomain) |
| + return false; |
| + return true; |
| +} |
| + |
| +/** |
| * @return {?WebInspector.ParsedURL} |
| */ |
| String.prototype.asParsedURL = function() |