diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /js/rust/src/lib.rs | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | js/rust/src/lib.rs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/js/rust/src/lib.rs b/js/rust/src/lib.rs new file mode 100644 index 0000000000..c16d1e1702 --- /dev/null +++ b/js/rust/src/lib.rs @@ -0,0 +1,53 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#![crate_name = "js"] +#![crate_type = "rlib"] +#![cfg_attr(feature = "nonzero", feature(nonzero))] +#![allow( + non_upper_case_globals, + non_camel_case_types, + non_snake_case, + improper_ctypes +)] + +#[cfg(feature = "nonzero")] +extern crate core; +#[macro_use] +extern crate lazy_static; +extern crate libc; +#[macro_use] +extern crate log; +#[allow(unused_extern_crates)] +extern crate mozjs_sys; +extern crate num_traits; + +#[macro_use] +pub mod rust; + +pub mod ar; +pub mod conversions; +pub mod error; +pub mod glue; +pub mod heap; +pub mod jsval; +pub mod panic; +pub mod sc; +pub mod typedarray; + +pub mod jsapi; +use self::jsapi::root::*; + +#[inline(always)] +pub unsafe fn JS_ARGV(_cx: *mut JSContext, vp: *mut JS::Value) -> *mut JS::Value { + vp.offset(2) +} + +impl JS::ObjectOpResult { + /// Set this ObjectOpResult to true and return true. + pub fn succeed(&mut self) -> bool { + self.code_ = JS::ObjectOpResult_SpecialCodes::OkCode as usize; + true + } +} |