mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
Minor rename for CodeFetch parameters
This bring it inline with terminology used in V8 See ResolveCallback in v8.h
This commit is contained in:
parent
f230734623
commit
52079b26db
4 changed files with 88 additions and 105 deletions
15
js/os.ts
15
js/os.ts
|
@ -25,18 +25,15 @@ export function exit(exitCode = 0): never {
|
||||||
}
|
}
|
||||||
|
|
||||||
// @internal
|
// @internal
|
||||||
export function codeFetch(
|
export function codeFetch(specifier: string, referrer: string): CodeInfo {
|
||||||
moduleSpecifier: string,
|
util.log("os.ts codeFetch", specifier, referrer);
|
||||||
containingFile: string
|
|
||||||
): CodeInfo {
|
|
||||||
util.log("os.ts codeFetch", moduleSpecifier, containingFile);
|
|
||||||
// Send CodeFetch message
|
// Send CodeFetch message
|
||||||
const builder = flatbuffers.createBuilder();
|
const builder = flatbuffers.createBuilder();
|
||||||
const moduleSpecifier_ = builder.createString(moduleSpecifier);
|
const specifier_ = builder.createString(specifier);
|
||||||
const containingFile_ = builder.createString(containingFile);
|
const referrer_ = builder.createString(referrer);
|
||||||
msg.CodeFetch.startCodeFetch(builder);
|
msg.CodeFetch.startCodeFetch(builder);
|
||||||
msg.CodeFetch.addModuleSpecifier(builder, moduleSpecifier_);
|
msg.CodeFetch.addSpecifier(builder, specifier_);
|
||||||
msg.CodeFetch.addContainingFile(builder, containingFile_);
|
msg.CodeFetch.addReferrer(builder, referrer_);
|
||||||
const inner = msg.CodeFetch.endCodeFetch(builder);
|
const inner = msg.CodeFetch.endCodeFetch(builder);
|
||||||
const baseRes = sendSync(builder, msg.Any.CodeFetch, inner);
|
const baseRes = sendSync(builder, msg.Any.CodeFetch, inner);
|
||||||
assert(baseRes != null);
|
assert(baseRes != null);
|
||||||
|
|
168
src/deno_dir.rs
168
src/deno_dir.rs
|
@ -20,6 +20,16 @@ use tempfile::TempDir;
|
||||||
use url;
|
use url;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct CodeFetchOutput {
|
||||||
|
pub module_name: String,
|
||||||
|
pub filename: String,
|
||||||
|
pub media_type: msg::MediaType,
|
||||||
|
pub source_code: String,
|
||||||
|
pub maybe_output_code: Option<String>,
|
||||||
|
pub maybe_source_map: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
pub struct DenoDir {
|
pub struct DenoDir {
|
||||||
// Example: /Users/rld/.deno/
|
// Example: /Users/rld/.deno/
|
||||||
pub root: PathBuf,
|
pub root: PathBuf,
|
||||||
|
@ -209,16 +219,12 @@ impl DenoDir {
|
||||||
|
|
||||||
pub fn code_fetch(
|
pub fn code_fetch(
|
||||||
self: &Self,
|
self: &Self,
|
||||||
module_specifier: &str,
|
specifier: &str,
|
||||||
containing_file: &str,
|
referrer: &str,
|
||||||
) -> Result<CodeFetchOutput, errors::DenoError> {
|
) -> Result<CodeFetchOutput, errors::DenoError> {
|
||||||
debug!(
|
debug!("code_fetch. specifier {} referrer {}", specifier, referrer);
|
||||||
"code_fetch. module_specifier {} containing_file {}",
|
|
||||||
module_specifier, containing_file
|
|
||||||
);
|
|
||||||
|
|
||||||
let (module_name, filename) =
|
let (module_name, filename) = self.resolve_module(specifier, referrer)?;
|
||||||
self.resolve_module(module_specifier, containing_file)?;
|
|
||||||
|
|
||||||
let result = self.get_source_code(module_name.as_str(), filename.as_str());
|
let result = self.get_source_code(module_name.as_str(), filename.as_str());
|
||||||
let mut out = match result {
|
let mut out = match result {
|
||||||
|
@ -230,7 +236,7 @@ impl DenoDir {
|
||||||
ErrorKind::NotFound,
|
ErrorKind::NotFound,
|
||||||
format!(
|
format!(
|
||||||
"Cannot resolve module \"{}\" from \"{}\"",
|
"Cannot resolve module \"{}\" from \"{}\"",
|
||||||
module_specifier, containing_file
|
specifier, referrer
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
|
@ -293,36 +299,36 @@ impl DenoDir {
|
||||||
// Returns (module name, local filename)
|
// Returns (module name, local filename)
|
||||||
fn resolve_module(
|
fn resolve_module(
|
||||||
self: &Self,
|
self: &Self,
|
||||||
module_specifier: &str,
|
specifier: &str,
|
||||||
containing_file: &str,
|
referrer: &str,
|
||||||
) -> Result<(String, String), url::ParseError> {
|
) -> Result<(String, String), url::ParseError> {
|
||||||
let module_name;
|
let module_name;
|
||||||
let filename;
|
let filename;
|
||||||
|
|
||||||
let module_specifier = self.src_file_to_url(module_specifier);
|
let specifier = self.src_file_to_url(specifier);
|
||||||
let containing_file = self.src_file_to_url(containing_file);
|
let referrer = self.src_file_to_url(referrer);
|
||||||
|
|
||||||
debug!(
|
debug!(
|
||||||
"resolve_module module_specifier {} containing_file {}",
|
"resolve_module specifier {} referrer {}",
|
||||||
module_specifier, containing_file
|
specifier, referrer
|
||||||
);
|
);
|
||||||
|
|
||||||
let j: Url = if containing_file == "."
|
let j: Url = if referrer == "."
|
||||||
|| is_remote(&module_specifier)
|
|| is_remote(&specifier)
|
||||||
|| Path::new(&module_specifier).is_absolute()
|
|| Path::new(&specifier).is_absolute()
|
||||||
{
|
{
|
||||||
parse_local_or_remote(&module_specifier)?
|
parse_local_or_remote(&specifier)?
|
||||||
} else if containing_file.ends_with('/') {
|
} else if referrer.ends_with('/') {
|
||||||
let r = Url::from_directory_path(&containing_file);
|
let r = Url::from_directory_path(&referrer);
|
||||||
// TODO(ry) Properly handle error.
|
// TODO(ry) Properly handle error.
|
||||||
if r.is_err() {
|
if r.is_err() {
|
||||||
error!("Url::from_directory_path error {}", containing_file);
|
error!("Url::from_directory_path error {}", referrer);
|
||||||
}
|
}
|
||||||
let base = r.unwrap();
|
let base = r.unwrap();
|
||||||
base.join(module_specifier.as_ref())?
|
base.join(specifier.as_ref())?
|
||||||
} else {
|
} else {
|
||||||
let base = parse_local_or_remote(&containing_file)?;
|
let base = parse_local_or_remote(&referrer)?;
|
||||||
base.join(module_specifier.as_ref())?
|
base.join(specifier.as_ref())?
|
||||||
};
|
};
|
||||||
|
|
||||||
match j.scheme() {
|
match j.scheme() {
|
||||||
|
@ -398,16 +404,6 @@ fn test_get_cache_filename() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct CodeFetchOutput {
|
|
||||||
pub module_name: String,
|
|
||||||
pub filename: String,
|
|
||||||
pub media_type: msg::MediaType,
|
|
||||||
pub source_code: String,
|
|
||||||
pub maybe_output_code: Option<String>,
|
|
||||||
pub maybe_source_map: Option<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub fn test_setup() -> (TempDir, DenoDir) {
|
pub fn test_setup() -> (TempDir, DenoDir) {
|
||||||
let temp_dir = TempDir::new().expect("tempdir fail");
|
let temp_dir = TempDir::new().expect("tempdir fail");
|
||||||
|
@ -560,15 +556,15 @@ fn test_code_fetch() {
|
||||||
let cwd_string = String::from(cwd.to_str().unwrap()) + "/";
|
let cwd_string = String::from(cwd.to_str().unwrap()) + "/";
|
||||||
|
|
||||||
// Test failure case.
|
// Test failure case.
|
||||||
let module_specifier = "hello.ts";
|
let specifier = "hello.ts";
|
||||||
let containing_file = add_root!("/baddir/badfile.ts");
|
let referrer = add_root!("/baddir/badfile.ts");
|
||||||
let r = deno_dir.code_fetch(module_specifier, containing_file);
|
let r = deno_dir.code_fetch(specifier, referrer);
|
||||||
assert!(r.is_err());
|
assert!(r.is_err());
|
||||||
|
|
||||||
// Assuming cwd is the deno repo root.
|
// Assuming cwd is the deno repo root.
|
||||||
let module_specifier = "./js/main.ts";
|
let specifier = "./js/main.ts";
|
||||||
let containing_file = cwd_string.as_str();
|
let referrer = cwd_string.as_str();
|
||||||
let r = deno_dir.code_fetch(module_specifier, containing_file);
|
let r = deno_dir.code_fetch(specifier, referrer);
|
||||||
assert!(r.is_ok());
|
assert!(r.is_ok());
|
||||||
//let code_fetch_output = r.unwrap();
|
//let code_fetch_output = r.unwrap();
|
||||||
//println!("code_fetch_output {:?}", code_fetch_output);
|
//println!("code_fetch_output {:?}", code_fetch_output);
|
||||||
|
@ -582,16 +578,16 @@ fn test_code_fetch_no_ext() {
|
||||||
let cwd_string = String::from(cwd.to_str().unwrap()) + "/";
|
let cwd_string = String::from(cwd.to_str().unwrap()) + "/";
|
||||||
|
|
||||||
// Assuming cwd is the deno repo root.
|
// Assuming cwd is the deno repo root.
|
||||||
let module_specifier = "./js/main";
|
let specifier = "./js/main";
|
||||||
let containing_file = cwd_string.as_str();
|
let referrer = cwd_string.as_str();
|
||||||
let r = deno_dir.code_fetch(module_specifier, containing_file);
|
let r = deno_dir.code_fetch(specifier, referrer);
|
||||||
assert!(r.is_ok());
|
assert!(r.is_ok());
|
||||||
|
|
||||||
// Test .ts extension
|
// Test .ts extension
|
||||||
// Assuming cwd is the deno repo root.
|
// Assuming cwd is the deno repo root.
|
||||||
let module_specifier = "./js/main";
|
let specifier = "./js/main";
|
||||||
let containing_file = cwd_string.as_str();
|
let referrer = cwd_string.as_str();
|
||||||
let r = deno_dir.code_fetch(module_specifier, containing_file);
|
let r = deno_dir.code_fetch(specifier, referrer);
|
||||||
assert!(r.is_ok());
|
assert!(r.is_ok());
|
||||||
let code_fetch_output = r.unwrap();
|
let code_fetch_output = r.unwrap();
|
||||||
// could only test .ends_with to avoid include local abs path
|
// could only test .ends_with to avoid include local abs path
|
||||||
|
@ -601,9 +597,9 @@ fn test_code_fetch_no_ext() {
|
||||||
|
|
||||||
// Test .js extension
|
// Test .js extension
|
||||||
// Assuming cwd is the deno repo root.
|
// Assuming cwd is the deno repo root.
|
||||||
let module_specifier = "./js/mock_builtin";
|
let specifier = "./js/mock_builtin";
|
||||||
let containing_file = cwd_string.as_str();
|
let referrer = cwd_string.as_str();
|
||||||
let r = deno_dir.code_fetch(module_specifier, containing_file);
|
let r = deno_dir.code_fetch(specifier, referrer);
|
||||||
assert!(r.is_ok());
|
assert!(r.is_ok());
|
||||||
let code_fetch_output = r.unwrap();
|
let code_fetch_output = r.unwrap();
|
||||||
// could only test .ends_with to avoid include local abs path
|
// could only test .ends_with to avoid include local abs path
|
||||||
|
@ -698,11 +694,10 @@ fn test_resolve_module_1() {
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
for &test in test_cases.iter() {
|
for &test in test_cases.iter() {
|
||||||
let module_specifier = String::from(test.0);
|
let specifier = String::from(test.0);
|
||||||
let containing_file = String::from(test.1);
|
let referrer = String::from(test.1);
|
||||||
let (module_name, filename) = deno_dir
|
let (module_name, filename) =
|
||||||
.resolve_module(&module_specifier, &containing_file)
|
deno_dir.resolve_module(&specifier, &referrer).unwrap();
|
||||||
.unwrap();
|
|
||||||
assert_eq!(module_name, test.2);
|
assert_eq!(module_name, test.2);
|
||||||
assert_eq!(filename, test.3);
|
assert_eq!(filename, test.3);
|
||||||
}
|
}
|
||||||
|
@ -712,8 +707,8 @@ fn test_resolve_module_1() {
|
||||||
fn test_resolve_module_2() {
|
fn test_resolve_module_2() {
|
||||||
let (_temp_dir, deno_dir) = test_setup();
|
let (_temp_dir, deno_dir) = test_setup();
|
||||||
|
|
||||||
let module_specifier = "http://localhost:4545/testdata/subdir/print_hello.ts";
|
let specifier = "http://localhost:4545/testdata/subdir/print_hello.ts";
|
||||||
let containing_file = add_root!("/deno/testdata/006_url_imports.ts");
|
let referrer = add_root!("/deno/testdata/006_url_imports.ts");
|
||||||
|
|
||||||
let expected_module_name =
|
let expected_module_name =
|
||||||
"http://localhost:4545/testdata/subdir/print_hello.ts";
|
"http://localhost:4545/testdata/subdir/print_hello.ts";
|
||||||
|
@ -724,9 +719,8 @@ fn test_resolve_module_2() {
|
||||||
.as_ref(),
|
.as_ref(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let (module_name, filename) = deno_dir
|
let (module_name, filename) =
|
||||||
.resolve_module(module_specifier, containing_file)
|
deno_dir.resolve_module(specifier, referrer).unwrap();
|
||||||
.unwrap();
|
|
||||||
assert_eq!(module_name, expected_module_name);
|
assert_eq!(module_name, expected_module_name);
|
||||||
assert_eq!(filename, expected_filename);
|
assert_eq!(filename, expected_filename);
|
||||||
}
|
}
|
||||||
|
@ -735,10 +729,9 @@ fn test_resolve_module_2() {
|
||||||
fn test_resolve_module_3() {
|
fn test_resolve_module_3() {
|
||||||
let (_temp_dir, deno_dir) = test_setup();
|
let (_temp_dir, deno_dir) = test_setup();
|
||||||
|
|
||||||
let module_specifier_ =
|
let specifier_ = deno_dir.deps_http.join("unpkg.com/liltest@0.0.5/index.ts");
|
||||||
deno_dir.deps_http.join("unpkg.com/liltest@0.0.5/index.ts");
|
let specifier = specifier_.to_str().unwrap();
|
||||||
let module_specifier = module_specifier_.to_str().unwrap();
|
let referrer = ".";
|
||||||
let containing_file = ".";
|
|
||||||
|
|
||||||
let expected_module_name = "http://unpkg.com/liltest@0.0.5/index.ts";
|
let expected_module_name = "http://unpkg.com/liltest@0.0.5/index.ts";
|
||||||
let expected_filename = deno_fs::normalize_path(
|
let expected_filename = deno_fs::normalize_path(
|
||||||
|
@ -748,9 +741,8 @@ fn test_resolve_module_3() {
|
||||||
.as_ref(),
|
.as_ref(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let (module_name, filename) = deno_dir
|
let (module_name, filename) =
|
||||||
.resolve_module(module_specifier, containing_file)
|
deno_dir.resolve_module(specifier, referrer).unwrap();
|
||||||
.unwrap();
|
|
||||||
assert_eq!(module_name, expected_module_name);
|
assert_eq!(module_name, expected_module_name);
|
||||||
assert_eq!(filename, expected_filename);
|
assert_eq!(filename, expected_filename);
|
||||||
}
|
}
|
||||||
|
@ -759,10 +751,9 @@ fn test_resolve_module_3() {
|
||||||
fn test_resolve_module_4() {
|
fn test_resolve_module_4() {
|
||||||
let (_temp_dir, deno_dir) = test_setup();
|
let (_temp_dir, deno_dir) = test_setup();
|
||||||
|
|
||||||
let module_specifier = "./util";
|
let specifier = "./util";
|
||||||
let containing_file_ =
|
let referrer_ = deno_dir.deps_http.join("unpkg.com/liltest@0.0.5/index.ts");
|
||||||
deno_dir.deps_http.join("unpkg.com/liltest@0.0.5/index.ts");
|
let referrer = referrer_.to_str().unwrap();
|
||||||
let containing_file = containing_file_.to_str().unwrap();
|
|
||||||
|
|
||||||
// http containing files -> load relative import with http
|
// http containing files -> load relative import with http
|
||||||
let expected_module_name = "http://unpkg.com/liltest@0.0.5/util";
|
let expected_module_name = "http://unpkg.com/liltest@0.0.5/util";
|
||||||
|
@ -773,9 +764,8 @@ fn test_resolve_module_4() {
|
||||||
.as_ref(),
|
.as_ref(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let (module_name, filename) = deno_dir
|
let (module_name, filename) =
|
||||||
.resolve_module(module_specifier, containing_file)
|
deno_dir.resolve_module(specifier, referrer).unwrap();
|
||||||
.unwrap();
|
|
||||||
assert_eq!(module_name, expected_module_name);
|
assert_eq!(module_name, expected_module_name);
|
||||||
assert_eq!(filename, expected_filename);
|
assert_eq!(filename, expected_filename);
|
||||||
}
|
}
|
||||||
|
@ -784,10 +774,9 @@ fn test_resolve_module_4() {
|
||||||
fn test_resolve_module_5() {
|
fn test_resolve_module_5() {
|
||||||
let (_temp_dir, deno_dir) = test_setup();
|
let (_temp_dir, deno_dir) = test_setup();
|
||||||
|
|
||||||
let module_specifier = "./util";
|
let specifier = "./util";
|
||||||
let containing_file_ =
|
let referrer_ = deno_dir.deps_https.join("unpkg.com/liltest@0.0.5/index.ts");
|
||||||
deno_dir.deps_https.join("unpkg.com/liltest@0.0.5/index.ts");
|
let referrer = referrer_.to_str().unwrap();
|
||||||
let containing_file = containing_file_.to_str().unwrap();
|
|
||||||
|
|
||||||
// https containing files -> load relative import with https
|
// https containing files -> load relative import with https
|
||||||
let expected_module_name = "https://unpkg.com/liltest@0.0.5/util";
|
let expected_module_name = "https://unpkg.com/liltest@0.0.5/util";
|
||||||
|
@ -798,9 +787,8 @@ fn test_resolve_module_5() {
|
||||||
.as_ref(),
|
.as_ref(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let (module_name, filename) = deno_dir
|
let (module_name, filename) =
|
||||||
.resolve_module(module_specifier, containing_file)
|
deno_dir.resolve_module(specifier, referrer).unwrap();
|
||||||
.unwrap();
|
|
||||||
assert_eq!(module_name, expected_module_name);
|
assert_eq!(module_name, expected_module_name);
|
||||||
assert_eq!(filename, expected_filename);
|
assert_eq!(filename, expected_filename);
|
||||||
}
|
}
|
||||||
|
@ -809,8 +797,8 @@ fn test_resolve_module_5() {
|
||||||
fn test_resolve_module_6() {
|
fn test_resolve_module_6() {
|
||||||
let (_temp_dir, deno_dir) = test_setup();
|
let (_temp_dir, deno_dir) = test_setup();
|
||||||
|
|
||||||
let module_specifier = "http://localhost:4545/tests/subdir/mod2.ts";
|
let specifier = "http://localhost:4545/tests/subdir/mod2.ts";
|
||||||
let containing_file = add_root!("/deno/tests/006_url_imports.ts");
|
let referrer = add_root!("/deno/tests/006_url_imports.ts");
|
||||||
let expected_module_name = "http://localhost:4545/tests/subdir/mod2.ts";
|
let expected_module_name = "http://localhost:4545/tests/subdir/mod2.ts";
|
||||||
let expected_filename = deno_fs::normalize_path(
|
let expected_filename = deno_fs::normalize_path(
|
||||||
deno_dir
|
deno_dir
|
||||||
|
@ -819,9 +807,8 @@ fn test_resolve_module_6() {
|
||||||
.as_ref(),
|
.as_ref(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let (module_name, filename) = deno_dir
|
let (module_name, filename) =
|
||||||
.resolve_module(module_specifier, containing_file)
|
deno_dir.resolve_module(specifier, referrer).unwrap();
|
||||||
.unwrap();
|
|
||||||
assert_eq!(module_name, expected_module_name);
|
assert_eq!(module_name, expected_module_name);
|
||||||
assert_eq!(filename, expected_filename);
|
assert_eq!(filename, expected_filename);
|
||||||
}
|
}
|
||||||
|
@ -830,14 +817,13 @@ fn test_resolve_module_6() {
|
||||||
fn test_resolve_module_7() {
|
fn test_resolve_module_7() {
|
||||||
let (_temp_dir, deno_dir) = test_setup();
|
let (_temp_dir, deno_dir) = test_setup();
|
||||||
|
|
||||||
let module_specifier = "http_test.ts";
|
let specifier = "http_test.ts";
|
||||||
let containing_file = add_root!("/Users/rld/src/deno_net/");
|
let referrer = add_root!("/Users/rld/src/deno_net/");
|
||||||
let expected_module_name = add_root!("/Users/rld/src/deno_net/http_test.ts");
|
let expected_module_name = add_root!("/Users/rld/src/deno_net/http_test.ts");
|
||||||
let expected_filename = add_root!("/Users/rld/src/deno_net/http_test.ts");
|
let expected_filename = add_root!("/Users/rld/src/deno_net/http_test.ts");
|
||||||
|
|
||||||
let (module_name, filename) = deno_dir
|
let (module_name, filename) =
|
||||||
.resolve_module(module_specifier, containing_file)
|
deno_dir.resolve_module(specifier, referrer).unwrap();
|
||||||
.unwrap();
|
|
||||||
assert_eq!(module_name, expected_module_name);
|
assert_eq!(module_name, expected_module_name);
|
||||||
assert_eq!(filename, expected_filename);
|
assert_eq!(filename, expected_filename);
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,8 +146,8 @@ table StartRes {
|
||||||
}
|
}
|
||||||
|
|
||||||
table CodeFetch {
|
table CodeFetch {
|
||||||
module_specifier: string;
|
specifier: string;
|
||||||
containing_file: string;
|
referrer: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
table CodeFetchRes {
|
table CodeFetchRes {
|
||||||
|
|
|
@ -256,14 +256,14 @@ fn op_code_fetch(
|
||||||
assert_eq!(data.len(), 0);
|
assert_eq!(data.len(), 0);
|
||||||
let inner = base.inner_as_code_fetch().unwrap();
|
let inner = base.inner_as_code_fetch().unwrap();
|
||||||
let cmd_id = base.cmd_id();
|
let cmd_id = base.cmd_id();
|
||||||
let module_specifier = inner.module_specifier().unwrap();
|
let specifier = inner.specifier().unwrap();
|
||||||
let containing_file = inner.containing_file().unwrap();
|
let referrer = inner.referrer().unwrap();
|
||||||
|
|
||||||
assert_eq!(state.dir.root.join("gen"), state.dir.gen, "Sanity check");
|
assert_eq!(state.dir.root.join("gen"), state.dir.gen, "Sanity check");
|
||||||
|
|
||||||
Box::new(futures::future::result(|| -> OpResult {
|
Box::new(futures::future::result(|| -> OpResult {
|
||||||
let builder = &mut FlatBufferBuilder::new();
|
let builder = &mut FlatBufferBuilder::new();
|
||||||
let out = state.dir.code_fetch(module_specifier, containing_file)?;
|
let out = state.dir.code_fetch(specifier, referrer)?;
|
||||||
let mut msg_args = msg::CodeFetchResArgs {
|
let mut msg_args = msg::CodeFetchResArgs {
|
||||||
module_name: Some(builder.create_string(&out.module_name)),
|
module_name: Some(builder.create_string(&out.module_name)),
|
||||||
filename: Some(builder.create_string(&out.filename)),
|
filename: Some(builder.create_string(&out.filename)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue