From 6e8e4a56cf97c8eb323d987c7fc9b59c379a0e94 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 7 Nov 2014 13:20:35 -0800 Subject: [PATCH] Use String::indexOf instead of String::startsWith String::startsWith isn't available in the browser process yet. --- src/package.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/package.coffee b/src/package.coffee index 3f1264020..b79b57788 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -31,10 +31,10 @@ class Package devMode ?= atom?.packages.devMode if devMode - return false unless resourcePath.startsWith("#{process.resourcesPath}#{path.sep}") + return false unless resourcePath.indexOf("#{process.resourcesPath}#{path.sep}") is 0 @resourcePathWithTrailingSlash ?= "#{resourcePath}#{path.sep}" - packagePath?.startsWith(@resourcePathWithTrailingSlash) + packagePath?.indexOf(@resourcePathWithTrailingSlash) is 0 @loadMetadata: (packagePath, {ignoreErrors, devMode, resourcePath}={}) -> packageName = path.basename(packagePath)