summaryrefslogtreecommitdiff
path: root/core/lib.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-06-13 20:03:10 -0600
committerGitHub <noreply@github.com>2023-06-14 02:03:10 +0000
commitec8e9d4f5bd2c8eed5f086356c1c6dd7c8b40b7f (patch)
tree2ffda9204901bfb757e8ce6359d1fc6aa2f9964b /core/lib.rs
parentfd9d6baea311d9b227b130749647a86838ba2ccc (diff)
chore(core): Refactor runtime and split out tests (#19491)
This is a quick first refactoring to split the tests out of runtime and move runtime-related code to a top-level runtime module. There will be a followup to refactor imports a bit, but this is the major change that will most likely conflict with other work and I want to merge it early.
Diffstat (limited to 'core/lib.rs')
-rw-r--r--core/lib.rs32
1 files changed, 19 insertions, 13 deletions
diff --git a/core/lib.rs b/core/lib.rs
index 336d9c2b9..82cd1dd43 100644
--- a/core/lib.rs
+++ b/core/lib.rs
@@ -1,7 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
mod async_cancel;
mod async_cell;
-mod bindings;
pub mod error;
mod error_codes;
mod extensions;
@@ -18,10 +17,8 @@ mod ops_builtin;
mod ops_builtin_v8;
mod ops_metrics;
mod path;
-mod realm;
mod resources;
mod runtime;
-pub mod snapshot_util;
mod source_map;
pub mod task;
mod task_queue;
@@ -57,6 +54,8 @@ pub use crate::async_cell::AsyncRefCell;
pub use crate::async_cell::AsyncRefFuture;
pub use crate::async_cell::RcLike;
pub use crate::async_cell::RcRef;
+pub use crate::error::GetErrorClassFn;
+pub use crate::error::JsErrorCreateFn;
pub use crate::extensions::Extension;
pub use crate::extensions::ExtensionBuilder;
pub use crate::extensions::ExtensionFileSource;
@@ -103,15 +102,13 @@ pub use crate::ops_builtin::op_void_async;
pub use crate::ops_builtin::op_void_sync;
pub use crate::ops_metrics::OpsTracker;
pub use crate::path::strip_unc_prefix;
-pub use crate::realm::JsRealm;
pub use crate::resources::AsyncResult;
pub use crate::resources::Resource;
pub use crate::resources::ResourceId;
pub use crate::resources::ResourceTable;
pub use crate::runtime::CompiledWasmModuleStore;
pub use crate::runtime::CrossIsolateStore;
-pub use crate::runtime::GetErrorClassFn;
-pub use crate::runtime::JsErrorCreateFn;
+pub use crate::runtime::JsRealm;
pub use crate::runtime::JsRuntime;
pub use crate::runtime::JsRuntimeForSnapshot;
pub use crate::runtime::RuntimeOptions;
@@ -130,21 +127,30 @@ pub fn v8_version() -> &'static str {
/// An internal module re-exporting functions used by the #[op] (`deno_ops`) macro
#[doc(hidden)]
pub mod _ops {
- pub use super::bindings::throw_type_error;
pub use super::error_codes::get_error_code;
pub use super::ops::to_op_result;
pub use super::ops::OpCtx;
pub use super::ops::OpResult;
- pub use super::runtime::map_async_op1;
- pub use super::runtime::map_async_op2;
- pub use super::runtime::map_async_op3;
- pub use super::runtime::map_async_op4;
- pub use super::runtime::queue_async_op;
- pub use super::runtime::queue_fast_async_op;
+ pub use super::runtime::ops::map_async_op1;
+ pub use super::runtime::ops::map_async_op2;
+ pub use super::runtime::ops::map_async_op3;
+ pub use super::runtime::ops::map_async_op4;
+ pub use super::runtime::ops::queue_async_op;
+ pub use super::runtime::ops::queue_fast_async_op;
+ pub use super::runtime::throw_type_error;
pub use super::runtime::V8_WRAPPER_OBJECT_INDEX;
pub use super::runtime::V8_WRAPPER_TYPE_INDEX;
}
+// TODO(mmastrac): Temporary while we move code around
+pub mod snapshot_util {
+ pub use crate::runtime::create_snapshot;
+ pub use crate::runtime::get_js_files;
+ pub use crate::runtime::CreateSnapshotOptions;
+ pub use crate::runtime::CreateSnapshotOutput;
+ pub use crate::runtime::FilterFn;
+}
+
/// A helper macro that will return a call site in Rust code. Should be
/// used when executing internal one-line scripts for JsRuntime lifecycle.
///