summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/BUILD.gn12
-rw-r--r--core/Cargo.toml6
-rw-r--r--core/core.d.ts26
-rw-r--r--core/libdeno/libdeno.d.ts41
-rw-r--r--core/snapshot_creator.rs44
5 files changed, 0 insertions, 129 deletions
diff --git a/core/BUILD.gn b/core/BUILD.gn
index 0f1eba8ca..bf9d910c0 100644
--- a/core/BUILD.gn
+++ b/core/BUILD.gn
@@ -7,7 +7,6 @@ group("default") {
":deno_core_http_bench",
":deno_core_http_bench_test",
":deno_core_test",
- ":snapshot_creator",
]
}
@@ -78,14 +77,3 @@ rust_test("deno_core_http_bench_test") {
extern = http_bench_extern
extern_rlib = http_bench_extern_rlib
}
-
-rust_executable("snapshot_creator") {
- source_root = "snapshot_creator.rs"
- extern = [
- {
- label = ":deno"
- crate_name = "deno"
- crate_type = "rlib"
- },
- ]
-}
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 02932df35..fd6f5548f 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -13,12 +13,6 @@ repository = "https://github.com/denoland/deno"
[lib]
path = "lib.rs"
-# NOTE: The ninja build of snapshot_creator gets clobbered by 'cargo build' if
-# the following is added. This breaks incremental 'cargo build'.
-# [[bin]]
-# name = "snapshot_creator"
-# path = "snapshot_creator.rs"
-
[dependencies]
futures = "0.1.28"
lazy_static = "1.3.0"
diff --git a/core/core.d.ts b/core/core.d.ts
deleted file mode 100644
index 1e9eb7c04..000000000
--- a/core/core.d.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-
-// This file contains APIs that are introduced into the global namespace by
-// Deno core. These are not intended to be used directly by runtime users of
-// Deno and therefore do not flow through to the runtime type library.
-
-declare interface MessageCallback {
- (opId: number, msg: Uint8Array): void;
-}
-
-declare interface DenoCore {
- dispatch(
- opId: number,
- control: Uint8Array,
- zeroCopy?: ArrayBufferView | null
- ): Uint8Array | null;
- setAsyncHandler(cb: MessageCallback): void;
- sharedQueue: {
- head(): number;
- numRecords(): number;
- size(): number;
- push(buf: Uint8Array): boolean;
- reset(): void;
- shift(): Uint8Array | null;
- };
-}
diff --git a/core/libdeno/libdeno.d.ts b/core/libdeno/libdeno.d.ts
deleted file mode 100644
index 8a26e49ca..000000000
--- a/core/libdeno/libdeno.d.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-
-interface EvalErrorInfo {
- // Is the object thrown a native Error?
- isNativeError: boolean;
- // Was the error happened during compilation?
- isCompileError: boolean;
- // The actual thrown entity
- // (might be an Error or anything else thrown by the user)
- // If isNativeError is true, this is an Error
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- thrown: any;
-}
-
-declare interface MessageCallback {
- (opId: number, msg: Uint8Array): void;
-}
-
-declare interface DenoCore {
- recv(cb: MessageCallback): void;
-
- send(
- opId: number,
- control: null | ArrayBufferView,
- data?: ArrayBufferView
- ): null | Uint8Array;
-
- print(x: string, isErr?: boolean): void;
-
- shared: SharedArrayBuffer;
-
- /** Evaluate provided code in the current context.
- * It differs from eval(...) in that it does not create a new context.
- * Returns an array: [output, errInfo].
- * If an error occurs, `output` becomes null and `errInfo` is non-null.
- */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- evalContext(code: string): [any, EvalErrorInfo | null];
-
- errorToJSON: (e: Error) => string;
-}
diff --git a/core/snapshot_creator.rs b/core/snapshot_creator.rs
deleted file mode 100644
index 1d43b9174..000000000
--- a/core/snapshot_creator.rs
+++ /dev/null
@@ -1,44 +0,0 @@
-// Note: This is a nearly identical rewrite of core/libdeno/snapshot_creator.cc
-// but in Rust.
-//
-// This snapshot program is considered "basic" because the code being
-// snapshotted cannot call ops.
-
-extern crate deno;
-
-use deno::js_check;
-use deno::Isolate;
-use deno::StartupData;
-use std::env;
-use std::io::Write;
-
-fn main() {
- let args: Vec<String> = env::args().collect();
- // NOTE: `--help` arg will display V8 help and exit
- let args = deno::v8_set_flags(args);
-
- let (snapshot_out_bin, js_filename) = if args.len() == 3 {
- (args[1].clone(), args[2].clone())
- } else {
- eprintln!("Usage: snapshot_creator <out_filename> <js_filename>");
- std::process::exit(1);
- };
-
- let js_source =
- std::fs::read(&js_filename).expect("couldn't read js_filename");
- let js_source_str = std::str::from_utf8(&js_source).unwrap();
-
- let will_snapshot = true;
- let mut isolate = Isolate::new(StartupData::None, will_snapshot);
-
- js_check(isolate.execute(&js_filename, js_source_str));
-
- let snapshot = isolate.snapshot().expect("error snapshotting");
-
- let mut out_file = std::fs::File::create(snapshot_out_bin).unwrap();
- let snapshot_slice =
- unsafe { std::slice::from_raw_parts(snapshot.data_ptr, snapshot.data_len) };
- out_file
- .write_all(snapshot_slice)
- .expect("Failed to write snapshot file");
-}