summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--deno_dir.go2
-rw-r--r--handlers.go6
-rw-r--r--util.go4
3 files changed, 6 insertions, 6 deletions
diff --git a/deno_dir.go b/deno_dir.go
index 841288936..b3a8c78b9 100644
--- a/deno_dir.go
+++ b/deno_dir.go
@@ -28,7 +28,7 @@ func CacheFileName(filename string, sourceCodeBuf []byte) string {
// Fetches a remoteUrl but also caches it to the localFilename.
func FetchRemoteSource(remoteUrl string, localFilename string) ([]byte, error) {
//println("FetchRemoteSource", remoteUrl)
- Assert(strings.HasPrefix(localFilename, SrcDir), localFilename)
+ assert(strings.HasPrefix(localFilename, SrcDir), localFilename)
var sourceReader io.Reader
file, err := os.Open(localFilename)
diff --git a/handlers.go b/handlers.go
index 5f9470ab1..d65361595 100644
--- a/handlers.go
+++ b/handlers.go
@@ -36,7 +36,7 @@ func recv(buf []byte) []byte {
}
func HandleSourceCodeFetch(moduleSpecifier string, containingFile string) (out []byte) {
- Assert(moduleSpecifier != "", "moduleSpecifier shouldn't be empty")
+ assert(moduleSpecifier != "", "moduleSpecifier shouldn't be empty")
res := &Msg{}
var sourceCodeBuf []byte
var err error
@@ -57,13 +57,13 @@ func HandleSourceCodeFetch(moduleSpecifier string, containingFile string) (out [
//println("HandleSourceCodeFetch", "moduleSpecifier", moduleSpecifier,
// "containingFile", containingFile, "filename", filename)
- if IsRemote(moduleName) {
+ if isRemote(moduleName) {
sourceCodeBuf, err = FetchRemoteSource(moduleName, filename)
} else if strings.HasPrefix(moduleName, assetPrefix) {
f := strings.TrimPrefix(moduleName, assetPrefix)
sourceCodeBuf, err = Asset("dist/" + f)
} else {
- Assert(moduleName == filename,
+ assert(moduleName == filename,
"if a module isn't remote, it should have the same filename")
sourceCodeBuf, err = ioutil.ReadFile(moduleName)
}
diff --git a/util.go b/util.go
index 803260920..3e0ac6374 100644
--- a/util.go
+++ b/util.go
@@ -4,13 +4,13 @@ import (
"net/url"
)
-func Assert(cond bool, msg string) {
+func assert(cond bool, msg string) {
if !cond {
panic(msg)
}
}
-func IsRemote(filename string) bool {
+func isRemote(filename string) bool {
u, err := url.Parse(filename)
check(err)
return u.IsAbs()