diff options
author | Ry Dahl <ry@tinyclouds.org> | 2020-01-21 14:57:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-21 14:57:56 -0500 |
commit | fa7f34eb8cec07f4c68ca4e9c46a983bc3e2308f (patch) | |
tree | 821263579dd75de3c16508fdecfdcaba52987373 /deno_typescript | |
parent | 7fd50065a7d8a4c6ed1b1090703a7baaabdbd6aa (diff) |
Revert "Create an old program to be used in snapshot. (#3644)"
Ref #3712. This change allowed the deno_typescript crate to reference
cli/js/lib.deno_runtime.d.ts which breaks "cargo package". We intend to
reintroduce a revised version of this patch later once "cargo
package" is working and tested.
This reverts commit 737ab94ea1bdf65eeef323ea37e84bcf430fb92c.
Diffstat (limited to 'deno_typescript')
-rw-r--r-- | deno_typescript/lib.rs | 8 | ||||
-rw-r--r-- | deno_typescript/ops.rs | 15 |
2 files changed, 0 insertions, 23 deletions
diff --git a/deno_typescript/lib.rs b/deno_typescript/lib.rs index c503d3508..016adcca0 100644 --- a/deno_typescript/lib.rs +++ b/deno_typescript/lib.rs @@ -203,10 +203,6 @@ pub fn mksnapshot_bundle_ts( state: Arc<Mutex<TSState>>, ) -> Result<(), ErrBox> { let runtime_isolate = &mut Isolate::new(StartupData::None, true); - runtime_isolate.register_op( - "fetch_asset", - compiler_op(state.clone(), ops::json_op(ops::fetch_asset)), - ); let source_code_vec = std::fs::read(bundle)?; let source_code = std::str::from_utf8(&source_code_vec)?; @@ -259,10 +255,6 @@ pub fn get_asset(name: &str) -> Option<&'static str> { } match name { "bundle_loader.js" => Some(include_str!("bundle_loader.js")), - "lib.deno_runtime.d.ts" => { - Some(include_str!("../cli/js/lib.deno_runtime.d.ts")) - } - "bootstrap.ts" => Some("console.log(\"hello deno\");"), "typescript.d.ts" => inc!("typescript.d.ts"), "lib.esnext.d.ts" => inc!("lib.esnext.d.ts"), "lib.es2020.d.ts" => inc!("lib.es2020.d.ts"), diff --git a/deno_typescript/ops.rs b/deno_typescript/ops.rs index d557b9b8c..e45349591 100644 --- a/deno_typescript/ops.rs +++ b/deno_typescript/ops.rs @@ -112,21 +112,6 @@ pub fn resolve_module_names( #[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 { code: i32, } |