From bd9561f4de8f940ce6ed8b5eedfa84161a749c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 22 Jan 2020 20:18:01 +0100 Subject: Reland "Create an old program to be used in snapshot." (#3747) * read CLI assets from disk during snapshotting --- cli/ops/compiler.rs | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'cli/ops/compiler.rs') diff --git a/cli/ops/compiler.rs b/cli/ops/compiler.rs index cb2fb01a0..e515081df 100644 --- a/cli/ops/compiler.rs +++ b/cli/ops/compiler.rs @@ -17,10 +17,6 @@ pub fn init(i: &mut Isolate, s: &ThreadSafeState) { "fetch_source_files", s.core_op(json_op(s.stateful_op(op_fetch_source_files))), ); - i.register_op( - "fetch_asset", - s.core_op(json_op(s.stateful_op(op_fetch_asset))), - ); } #[derive(Deserialize)] @@ -149,21 +145,3 @@ fn op_fetch_source_files( Ok(JsonOp::Async(future)) } - -#[derive(Deserialize)] -struct FetchAssetArgs { - name: String, -} - -fn op_fetch_asset( - _state: &ThreadSafeState, - args: Value, - _zero_copy: Option, -) -> Result { - let args: FetchAssetArgs = serde_json::from_value(args)?; - if let Some(source_code) = crate::js::get_asset(&args.name) { - Ok(JsonOp::Sync(json!(source_code))) - } else { - panic!("op_fetch_asset bad asset {}", args.name) - } -} -- cgit v1.2.3