refactor: move transpiling to deno_ast (#13332)

This commit is contained in:
David Sherret 2022-01-13 11:58:00 -05:00 committed by GitHub
parent 5e2d7737f5
commit f12164646b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 302 additions and 1642 deletions

View file

@ -30,10 +30,10 @@ struct StubDocLoader;
impl Loader for StubDocLoader {
fn load(
&mut self,
specifier: &ModuleSpecifier,
_specifier: &ModuleSpecifier,
_is_dynamic: bool,
) -> LoadFuture {
Box::pin(future::ready((specifier.clone(), Ok(None))))
Box::pin(future::ready(Ok(None)))
}
}
@ -74,18 +74,16 @@ impl Loader for DocLoader {
let specifier = specifier.clone();
let ps = self.ps.clone();
async move {
let result = ps
.file_fetcher
ps.file_fetcher
.fetch(&specifier, &mut Permissions::allow_all())
.await
.map(|file| {
Some(LoadResponse {
specifier: specifier.clone(),
specifier,
content: file.source.clone(),
maybe_headers: file.maybe_headers,
})
});
(specifier.clone(), result)
})
}
.boxed_local()
}
@ -113,6 +111,7 @@ pub async fn print_docs(
None,
None,
None,
None,
)
.await;
let doc_parser =
@ -152,6 +151,7 @@ pub async fn print_docs(
Some(&resolver),
None,
None,
None,
)
.await;
let doc_parser =