diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-05-07 15:57:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 15:57:10 +0200 |
commit | 0ba90c8c11089500b23761f126a8d08afd38a73e (patch) | |
tree | 593af7487ba351c16869b3e6eef0141be1d43adf /cli/state.rs | |
parent | dabe88f854b7cc04518c5ff75c55fa437360a91f (diff) |
fix(imports): fix panic on unsupported scheme (#5131)
Diffstat (limited to 'cli/state.rs')
-rw-r--r-- | cli/state.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/state.rs b/cli/state.rs index acf418189..9fd719646 100644 --- a/cli/state.rs +++ b/cli/state.rs @@ -1,5 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use crate::compilers::TargetLib; +use crate::file_fetcher::SourceFileFetcher; use crate::global_state::GlobalState; use crate::global_timer::GlobalTimer; use crate::import_map::ImportMap; @@ -474,6 +475,10 @@ impl State { module_specifier: &ModuleSpecifier, ) -> Result<(), OpError> { let u = module_specifier.as_url(); + // TODO(bartlomieju): temporary fix to prevent hitting `unreachable` + // statement that is actually reachable... + SourceFileFetcher::check_if_supported_scheme(u)?; + match u.scheme() { "http" | "https" => { self.check_net_url(u)?; |