From 3bd9b4b8bac20577a6f253bd29a9ba0aa59d9fe7 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Tue, 16 Jan 2018 08:07:43 -0700 Subject: [PATCH] Don't lean on startsWith support --- source-map-support.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source-map-support.js b/source-map-support.js index 5a1007a..076880f 100644 --- a/source-map-support.js +++ b/source-map-support.js @@ -64,7 +64,7 @@ var retrieveFile = handlerExec(retrieveFileHandlers); retrieveFileHandlers.push(function(path) { // Trim the path to make sure there is no extra whitespace. path = path.trim(); - if (path.startsWith('file:')) { + if (/^file:/.test(path)) { // existsSync/readFileSync can't handle file protocol, but once stripped, it works path = path.replace(/file:\/\/(\w:\\|\/)/, ''); }