summaryrefslogtreecommitdiff
path: root/cli/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/build.rs')
-rw-r--r--cli/build.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/cli/build.rs b/cli/build.rs
index 4b26a24b0..40b803979 100644
--- a/cli/build.rs
+++ b/cli/build.rs
@@ -1,8 +1,11 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
+
mod op_fetch_asset;
use deno_core::js_check;
+use deno_core::BasicState;
use deno_core::CoreIsolate;
+use deno_core::OpRegistry;
use deno_core::StartupData;
use std::collections::HashMap;
use std::env;
@@ -28,8 +31,9 @@ fn create_snapshot(
}
fn create_runtime_snapshot(snapshot_path: &Path, files: Vec<String>) {
- let runtime_isolate = CoreIsolate::new(StartupData::None, true);
- create_snapshot(runtime_isolate, snapshot_path, files);
+ let state = BasicState::new();
+ let isolate = CoreIsolate::new(state, StartupData::None, true);
+ create_snapshot(isolate, snapshot_path, files);
}
fn create_compiler_snapshot(
@@ -37,7 +41,6 @@ fn create_compiler_snapshot(
files: Vec<String>,
cwd: &Path,
) {
- let mut runtime_isolate = CoreIsolate::new(StartupData::None, true);
let mut custom_libs: HashMap<String, PathBuf> = HashMap::new();
custom_libs
.insert("lib.deno.web.d.ts".to_string(), deno_web::get_declaration());
@@ -61,11 +64,15 @@ fn create_compiler_snapshot(
"lib.deno.unstable.d.ts".to_string(),
cwd.join("dts/lib.deno.unstable.d.ts"),
);
- runtime_isolate.register_op(
+
+ let state = BasicState::new();
+ state.register_op(
"op_fetch_asset",
op_fetch_asset::op_fetch_asset(custom_libs),
);
- create_snapshot(runtime_isolate, snapshot_path, files);
+
+ let isolate = CoreIsolate::new(state, StartupData::None, true);
+ create_snapshot(isolate, snapshot_path, files);
}
fn ts_version() -> String {