From c824eb5817db675be4d9966a0d1a43d90dfa61fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 25 Jan 2020 18:53:16 +0100 Subject: refactor: Modules and Loader trait (#3791) * move is_dyn_import argument from Loader::resolve to Loader::load - it was always kind of strange that resolve() checks permissions. * change argument type from &str to &ModuleSpecifier where applicable --- cli/ops/compiler.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'cli/ops/compiler.rs') diff --git a/cli/ops/compiler.rs b/cli/ops/compiler.rs index 2d0ffe1f3..d2a2a1d58 100644 --- a/cli/ops/compiler.rs +++ b/cli/ops/compiler.rs @@ -58,11 +58,6 @@ fn op_resolve_modules( _data: Option, ) -> Result { let args: SpecifiersReferrerArgs = serde_json::from_value(args)?; - - // TODO(ry) Maybe a security hole. Only the compiler worker should have access - // to this. Need a test to demonstrate the hole. - let is_dyn_import = false; - let (referrer, is_main) = if let Some(referrer) = args.referrer { (referrer, false) } else { @@ -72,8 +67,7 @@ fn op_resolve_modules( let mut specifiers = vec![]; for specifier in &args.specifiers { - let resolved_specifier = - state.resolve(specifier, &referrer, is_main, is_dyn_import); + let resolved_specifier = state.resolve(specifier, &referrer, is_main); match resolved_specifier { Ok(ms) => specifiers.push(ms.as_str().to_owned()), Err(err) => return Err(err), -- cgit v1.2.3