Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit fb049f2

Browse files
committed
Merge pull request #10647 from MarcelGerber/tern-protocol-relative-urls
Don't try to handle protocol-relative URLs from Tern
2 parents 53165a1 + ac59d3d commit fb049f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/extensions/default/JavaScriptCodeHints/ScopeManager.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,8 @@ define(function (require, exports, module) {
858858
* @return {jQuery.Promise} - the Promise returned from DocumentMangaer.getDocumentText()
859859
*/
860860
function getDocText(filePath) {
861-
if (!FileSystem.isAbsolutePath(filePath)) {
861+
if (!FileSystem.isAbsolutePath(filePath) || // don't handle URLs
862+
filePath.slice(0, 2) === "//") { // don't handle protocol-relative URLs like //example.com/main.js (see #10566)
862863
return (new $.Deferred()).reject().promise();
863864
}
864865

@@ -1534,4 +1535,4 @@ define(function (require, exports, module) {
15341535
exports.handleProjectOpen = handleProjectOpen;
15351536
exports._readyPromise = _readyPromise;
15361537

1537-
});
1538+
});

0 commit comments

Comments
 (0)