diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2021-02-17 13:47:18 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-17 13:47:18 -0500 |
commit | c7dabc99eed50fa20cdcafd7c0175ab615da3d50 (patch) | |
tree | ec2c611c627827bbdd61d3e27400ae1b9a50d459 /cli/ast.rs | |
parent | f6d6b24506410816833d802e1a8d9cd704f73289 (diff) |
Make ModuleSpecifier a type alias, not wrapper struct (#9531)
Diffstat (limited to 'cli/ast.rs')
-rw-r--r-- | cli/ast.rs | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/cli/ast.rs b/cli/ast.rs index 7aeb1cebc..156faf972 100644 --- a/cli/ast.rs +++ b/cli/ast.rs @@ -4,6 +4,7 @@ use crate::media_type::MediaType; use crate::tsc_config; use deno_core::error::AnyError; +use deno_core::resolve_url_or_path; use deno_core::serde_json; use deno_core::ModuleSpecifier; use std::error::Error; @@ -78,7 +79,7 @@ impl Into<Location> for swc_common::Loc { impl Into<ModuleSpecifier> for Location { fn into(self) -> ModuleSpecifier { - ModuleSpecifier::resolve_url_or_path(&self.filename).unwrap() + resolve_url_or_path(&self.filename).unwrap() } } @@ -593,9 +594,7 @@ mod tests { #[test] fn test_parsed_module_analyze_dependencies() { - let specifier = - ModuleSpecifier::resolve_url_or_path("https://deno.land/x/mod.js") - .unwrap(); + let specifier = resolve_url_or_path("https://deno.land/x/mod.js").unwrap(); let source = r#"import * as bar from "./test.ts"; const foo = await import("./foo.ts"); "#; @@ -634,9 +633,8 @@ mod tests { #[test] fn test_transpile() { - let specifier = - ModuleSpecifier::resolve_url_or_path("https://deno.land/x/mod.ts") - .expect("could not resolve specifier"); + let specifier = resolve_url_or_path("https://deno.land/x/mod.ts") + .expect("could not resolve specifier"); let source = r#" enum D { A, @@ -668,9 +666,8 @@ mod tests { #[test] fn test_transpile_tsx() { - let specifier = - ModuleSpecifier::resolve_url_or_path("https://deno.land/x/mod.ts") - .expect("could not resolve specifier"); + let specifier = resolve_url_or_path("https://deno.land/x/mod.ts") + .expect("could not resolve specifier"); let source = r#" export class A { render() { @@ -688,9 +685,8 @@ mod tests { #[test] fn test_transpile_decorators() { - let specifier = - ModuleSpecifier::resolve_url_or_path("https://deno.land/x/mod.ts") - .expect("could not resolve specifier"); + let specifier = resolve_url_or_path("https://deno.land/x/mod.ts") + .expect("could not resolve specifier"); let source = r#" function enumerable(value: boolean) { return function ( @@ -701,7 +697,7 @@ mod tests { descriptor.enumerable = value; }; } - + export class A { @enumerable(false) a() { |