diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2020-04-28 01:12:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-28 01:12:38 +0200 |
commit | e6f70c77ee675848b084e6c5e6342ad516293d39 (patch) | |
tree | f7a8868721dbb6c9c15726587ed180a7af0f7b0c /cli/state.rs | |
parent | 4041a7b8576047021c2eec711f013c6f01e471e0 (diff) |
Make import maps unstable (#4934)
Diffstat (limited to 'cli/state.rs')
-rw-r--r-- | cli/state.rs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/cli/state.rs b/cli/state.rs index 40662b563..32c027c03 100644 --- a/cli/state.rs +++ b/cli/state.rs @@ -240,15 +240,19 @@ impl State { // stack trace in JS. let s = self.0.borrow(); if !s.global_state.flags.unstable { - eprintln!( - "Unstable API '{}'. The --unstable flag must be provided.", - api_name - ); - std::process::exit(70); + exit_unstable(api_name); } } } +fn exit_unstable(api_name: &str) { + eprintln!( + "Unstable API '{}'. The --unstable flag must be provided.", + api_name + ); + std::process::exit(70); +} + impl ModuleLoader for State { fn resolve( &self, @@ -318,7 +322,12 @@ impl State { let import_map: Option<ImportMap> = match global_state.flags.import_map_path.as_ref() { None => None, - Some(file_path) => Some(ImportMap::load(file_path)?), + Some(file_path) => { + if !global_state.flags.unstable { + exit_unstable("--importmap") + } + Some(ImportMap::load(file_path)?) + } }; let seeded_rng = match global_state.flags.seed { |