summaryrefslogtreecommitdiff
path: root/cli/build.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-09-11 15:18:49 +0200
committerGitHub <noreply@github.com>2020-09-11 15:18:49 +0200
commit0d1f626edd7c574ff0e70438cdb678dcb5c91170 (patch)
tree8d80e4f32ba9535da4c387234b795385ee2f6492 /cli/build.rs
parent7c2e7c660804afca823d60e6496aa853f75db16c (diff)
refactor(core): JsRuntime initialization (#7415)
Removes: - "deno_core::StartupData" - "deno_core::Script" - "deno_core::OwnedScript" Changes to "JsRuntime": - remove "new_with_loader()" - remove "with_heap_limits()" - rename "IsolateOptions" to "RuntimeOptions" and make public - "JsRuntime::new()" takes "RuntimeOptions" as a single param
Diffstat (limited to 'cli/build.rs')
-rw-r--r--cli/build.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/cli/build.rs b/cli/build.rs
index f2abb9529..7ed947f4e 100644
--- a/cli/build.rs
+++ b/cli/build.rs
@@ -4,7 +4,7 @@ mod op_fetch_asset;
use deno_core::js_check;
use deno_core::JsRuntime;
-use deno_core::StartupData;
+use deno_core::RuntimeOptions;
use std::collections::HashMap;
use std::env;
use std::path::Path;
@@ -37,7 +37,10 @@ fn create_snapshot(
}
fn create_runtime_snapshot(snapshot_path: &Path, files: Vec<PathBuf>) {
- let isolate = JsRuntime::new(StartupData::None, true);
+ let isolate = JsRuntime::new(RuntimeOptions {
+ will_snapshot: true,
+ ..Default::default()
+ });
create_snapshot(isolate, snapshot_path, files);
}
@@ -70,7 +73,10 @@ fn create_compiler_snapshot(
cwd.join("dts/lib.deno.unstable.d.ts"),
);
- let mut isolate = JsRuntime::new(StartupData::None, true);
+ let mut isolate = JsRuntime::new(RuntimeOptions {
+ will_snapshot: true,
+ ..Default::default()
+ });
isolate.register_op(
"op_fetch_asset",
op_fetch_asset::op_fetch_asset(custom_libs),