2021-01-10 21:59:07 -05:00
|
|
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
2020-01-06 11:38:56 -05:00
|
|
|
|
2020-01-05 09:19:29 -05:00
|
|
|
#[macro_use]
|
|
|
|
extern crate lazy_static;
|
2020-03-02 17:20:16 -05:00
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
2019-02-26 17:36:05 -05:00
|
|
|
|
2020-12-03 17:52:55 -05:00
|
|
|
mod async_cancel;
|
2020-11-24 18:38:23 -05:00
|
|
|
mod async_cell;
|
2020-01-06 10:24:44 -05:00
|
|
|
mod bindings;
|
2020-09-14 12:48:57 -04:00
|
|
|
pub mod error;
|
2019-03-11 17:57:36 -04:00
|
|
|
mod flags;
|
2020-09-10 09:57:45 -04:00
|
|
|
mod gotham_state;
|
2019-06-12 19:55:59 -04:00
|
|
|
mod module_specifier;
|
2019-03-26 11:56:34 -04:00
|
|
|
mod modules;
|
2020-08-12 16:34:17 -04:00
|
|
|
mod normalize_path;
|
2019-09-30 14:59:44 -04:00
|
|
|
mod ops;
|
2020-05-11 14:20:14 -04:00
|
|
|
pub mod plugin_api;
|
2019-10-23 12:32:28 -04:00
|
|
|
mod resources;
|
2020-09-06 15:44:29 -04:00
|
|
|
mod runtime;
|
2019-03-14 19:17:52 -04:00
|
|
|
mod shared_queue;
|
2020-05-28 13:36:43 -04:00
|
|
|
mod zero_copy_buf;
|
2019-02-26 17:36:05 -05:00
|
|
|
|
2020-09-16 14:28:07 -04:00
|
|
|
// Re-exports
|
|
|
|
pub use futures;
|
2020-03-27 16:09:51 -04:00
|
|
|
pub use rusty_v8 as v8;
|
2020-10-09 15:45:40 -04:00
|
|
|
pub use serde;
|
2020-09-16 14:28:07 -04:00
|
|
|
pub use serde_json;
|
|
|
|
pub use url;
|
2020-01-05 09:19:29 -05:00
|
|
|
|
2020-12-03 17:52:55 -05:00
|
|
|
pub use crate::async_cancel::CancelFuture;
|
|
|
|
pub use crate::async_cancel::CancelHandle;
|
|
|
|
pub use crate::async_cancel::CancelTryFuture;
|
|
|
|
pub use crate::async_cancel::Cancelable;
|
|
|
|
pub use crate::async_cancel::Canceled;
|
|
|
|
pub use crate::async_cancel::TryCancelable;
|
2020-11-24 18:38:23 -05:00
|
|
|
pub use crate::async_cell::AsyncMut;
|
|
|
|
pub use crate::async_cell::AsyncMutFuture;
|
|
|
|
pub use crate::async_cell::AsyncRef;
|
|
|
|
pub use crate::async_cell::AsyncRefCell;
|
|
|
|
pub use crate::async_cell::AsyncRefFuture;
|
2020-12-03 17:52:55 -05:00
|
|
|
pub use crate::async_cell::RcLike;
|
2020-11-24 18:38:23 -05:00
|
|
|
pub use crate::async_cell::RcRef;
|
2019-03-11 17:57:36 -04:00
|
|
|
pub use crate::flags::v8_set_flags;
|
2020-05-28 13:36:43 -04:00
|
|
|
pub use crate::module_specifier::ModuleResolutionError;
|
|
|
|
pub use crate::module_specifier::ModuleSpecifier;
|
2020-11-27 16:45:38 -05:00
|
|
|
pub use crate::modules::FsModuleLoader;
|
2020-05-28 13:36:43 -04:00
|
|
|
pub use crate::modules::ModuleId;
|
|
|
|
pub use crate::modules::ModuleLoadId;
|
|
|
|
pub use crate::modules::ModuleLoader;
|
|
|
|
pub use crate::modules::ModuleSource;
|
|
|
|
pub use crate::modules::ModuleSourceFuture;
|
2020-12-11 12:49:26 -05:00
|
|
|
pub use crate::modules::NoopModuleLoader;
|
2020-05-28 13:36:43 -04:00
|
|
|
pub use crate::modules::RecursiveModuleLoad;
|
2020-08-12 16:34:17 -04:00
|
|
|
pub use crate::normalize_path::normalize_path;
|
2020-09-10 09:57:45 -04:00
|
|
|
pub use crate::ops::json_op_async;
|
|
|
|
pub use crate::ops::json_op_sync;
|
2020-09-17 12:09:50 -04:00
|
|
|
pub use crate::ops::op_close;
|
|
|
|
pub use crate::ops::op_resources;
|
2020-05-28 13:36:43 -04:00
|
|
|
pub use crate::ops::Op;
|
|
|
|
pub use crate::ops::OpAsyncFuture;
|
2020-09-05 20:34:02 -04:00
|
|
|
pub use crate::ops::OpFn;
|
2020-05-28 13:36:43 -04:00
|
|
|
pub use crate::ops::OpId;
|
2020-09-10 09:57:45 -04:00
|
|
|
pub use crate::ops::OpState;
|
2020-09-05 20:34:02 -04:00
|
|
|
pub use crate::ops::OpTable;
|
2020-12-16 11:14:12 -05:00
|
|
|
pub use crate::resources::Resource;
|
|
|
|
pub use crate::resources::ResourceId;
|
2020-05-28 13:36:43 -04:00
|
|
|
pub use crate::resources::ResourceTable;
|
2020-09-06 15:44:29 -04:00
|
|
|
pub use crate::runtime::GetErrorClassFn;
|
2020-12-01 17:33:44 -05:00
|
|
|
pub use crate::runtime::JsErrorCreateFn;
|
2020-09-06 15:44:29 -04:00
|
|
|
pub use crate::runtime::JsRuntime;
|
2020-09-11 09:18:49 -04:00
|
|
|
pub use crate::runtime::RuntimeOptions;
|
2020-09-06 15:44:29 -04:00
|
|
|
pub use crate::runtime::Snapshot;
|
2020-08-18 08:07:57 -04:00
|
|
|
pub use crate::zero_copy_buf::BufVec;
|
2020-05-28 13:36:43 -04:00
|
|
|
pub use crate::zero_copy_buf::ZeroCopyBuf;
|
2019-02-26 17:36:05 -05:00
|
|
|
|
2019-03-11 17:57:36 -04:00
|
|
|
pub fn v8_version() -> &'static str {
|
2020-01-05 09:19:29 -05:00
|
|
|
v8::V8::get_version()
|
2019-02-26 17:36:05 -05:00
|
|
|
}
|
|
|
|
|
2021-02-01 10:55:23 -05:00
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
use super::*;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_v8_version() {
|
|
|
|
assert!(v8_version().len() > 3);
|
|
|
|
}
|
2019-02-26 17:36:05 -05:00
|
|
|
}
|