mirror of
https://github.com/denoland/deno.git
synced 2025-09-14 22:55:03 +00:00
Create an old program to be used in snapshot. (#3644)
This commit is contained in:
parent
8fac8ab130
commit
737ab94ea1
14 changed files with 85 additions and 60 deletions
|
@ -110,6 +110,21 @@ pub fn resolve_module_names(
|
|||
Ok(json!(resolved))
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct FetchAssetArgs {
|
||||
name: String,
|
||||
}
|
||||
|
||||
pub fn fetch_asset(_s: &mut TSState, v: Value) -> Result<Value, ErrBox> {
|
||||
let args: FetchAssetArgs = serde_json::from_value(v)?;
|
||||
if let Some(source_code) = crate::get_asset(&args.name) {
|
||||
Ok(json!(source_code))
|
||||
} else {
|
||||
panic!("op_fetch_asset bad asset {}", args.name)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct Exit {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue