diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f14299a..4d9c4da5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -372,6 +372,7 @@ jobs: run: | cargo clean cargo build ${{ matrix.optimization && '--release' || '' }} --manifest-path sys/Cargo.toml --target ${{ matrix.target }} --features bindgen,update-bindings,logging + cat sys/src/bindings/${{ matrix.target }}.rs - name: Upload bindings if: matrix.task == 'bindings' uses: actions/upload-artifact@v4 @@ -381,7 +382,10 @@ jobs: overwrite: true - name: Build if: ${{ !matrix.no-build }} - run: cargo build ${{ matrix.optimization && '--release' || '' }} --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} + env: + BUILD_TARGET: ${{ matrix.target }} + run: | + cargo build ${{ matrix.optimization && '--release' || '' }} --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} - name: Test if: ${{ !matrix.no-build && !matrix.no-test }} timeout-minutes: 12 diff --git a/.gitmodules b/.gitmodules index 56af563a..89f7ad5c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "rquickjs-sys/quickjs"] path = sys/quickjs - url = https://github.com/bellard/quickjs.git + url = https://github.com/quickjs-ng/quickjs.git diff --git a/core/src/allocator.rs b/core/src/allocator.rs index d4b2063a..f4d9f43d 100644 --- a/core/src/allocator.rs +++ b/core/src/allocator.rs @@ -1,7 +1,6 @@ //! Tools for using different allocators with QuickJS. use crate::qjs; -use std::ptr; mod rust; @@ -24,6 +23,11 @@ pub unsafe trait Allocator { /// fn alloc(&mut self, size: usize) -> *mut u8; + /// Allocates memory for an array of num objects of size and initializes all bytes in the allocated storage to zero. + /// + /// + fn calloc(&mut self, count: usize, size: usize) -> *mut u8; + /// De-allocate previously allocated memory /// /// # Safety @@ -65,6 +69,7 @@ impl AllocatorHolder { A: Allocator, { qjs::JSMallocFunctions { + js_calloc: Some(Self::calloc::), js_malloc: Some(Self::malloc::), js_free: Some(Self::free::), js_realloc: Some(Self::realloc::), @@ -83,47 +88,30 @@ impl AllocatorHolder { self.0 } - fn size_t(size: usize) -> qjs::size_t { - size.try_into().expect(qjs::SIZE_T_ERROR) - } - - unsafe extern "C" fn malloc( - state: *mut qjs::JSMallocState, + unsafe extern "C" fn calloc( + opaque: *mut qjs::c_void, + count: qjs::size_t, size: qjs::size_t, ) -> *mut qjs::c_void where A: Allocator, { - if size == 0 { - return ptr::null_mut(); - } - - let state = &mut *state; - - if state.malloc_size + size > state.malloc_limit { - return ptr::null_mut(); - } - + let allocator = &mut *(opaque as *mut DynAllocator); let rust_size: usize = size.try_into().expect(qjs::SIZE_T_ERROR); - // simulate the default behavior of libc::malloc - - let allocator = &mut *(state.opaque as *mut DynAllocator); - - let res = allocator.alloc(rust_size as _); - - if res.is_null() { - return ptr::null_mut(); - } - - let size = A::usable_size(res); - - state.malloc_count += 1; - state.malloc_size += Self::size_t(size); + let rust_count: usize = count.try_into().expect(qjs::SIZE_T_ERROR); + allocator.calloc(rust_count, rust_size) as *mut qjs::c_void + } - res as *mut qjs::c_void + unsafe extern "C" fn malloc(opaque: *mut qjs::c_void, size: qjs::size_t) -> *mut qjs::c_void + where + A: Allocator, + { + let allocator = &mut *(opaque as *mut DynAllocator); + let rust_size: usize = size.try_into().expect(qjs::SIZE_T_ERROR); + allocator.alloc(rust_size) as *mut qjs::c_void } - unsafe extern "C" fn free(state: *mut qjs::JSMallocState, ptr: *mut qjs::c_void) + unsafe extern "C" fn free(opaque: *mut qjs::c_void, ptr: *mut qjs::c_void) where A: Allocator, { @@ -133,56 +121,21 @@ impl AllocatorHolder { return; } - let state = &mut *state; - state.malloc_count -= 1; - - let size = A::usable_size(ptr as *mut u8); - - let allocator = &mut *(state.opaque as *mut DynAllocator); + let allocator = &mut *(opaque as *mut DynAllocator); allocator.dealloc(ptr as _); - - state.malloc_size -= Self::size_t(size); } unsafe extern "C" fn realloc( - state: *mut qjs::JSMallocState, + opaque: *mut qjs::c_void, ptr: *mut qjs::c_void, size: qjs::size_t, ) -> *mut qjs::c_void where A: Allocator, { - let state_ref = &mut *state; - let allocator = &mut *(state_ref.opaque as *mut DynAllocator); - - // simulate the default behavior of libc::realloc - if ptr.is_null() { - return Self::malloc::(state, size); - } else if size == 0 { - Self::free::(state, ptr); - return ptr::null_mut(); - } - - let old_size = Self::size_t(A::usable_size(ptr as *mut u8)); - - let new_malloc_size = state_ref.malloc_size - old_size + size; - if new_malloc_size > state_ref.malloc_limit { - return ptr::null_mut(); - } - - let ptr = allocator.realloc(ptr as _, size.try_into().expect(qjs::SIZE_T_ERROR)) - as *mut qjs::c_void; - - if ptr.is_null() { - return ptr::null_mut(); - } - - let actual_size = Self::size_t(A::usable_size(ptr as *mut u8)); - - state_ref.malloc_size -= old_size; - state_ref.malloc_size += actual_size; - - ptr + let rust_size: usize = size.try_into().expect(qjs::SIZE_T_ERROR); + let allocator = &mut *(opaque as *mut DynAllocator); + allocator.realloc(ptr as _, rust_size) as *mut qjs::c_void } unsafe extern "C" fn malloc_usable_size(ptr: *const qjs::c_void) -> qjs::size_t diff --git a/core/src/allocator/rust.rs b/core/src/allocator/rust.rs index 21967b63..7158dc78 100644 --- a/core/src/allocator/rust.rs +++ b/core/src/allocator/rust.rs @@ -35,6 +35,37 @@ fn round_size(size: usize) -> usize { pub struct RustAllocator; unsafe impl Allocator for RustAllocator { + fn calloc(&mut self, count: usize, size: usize) -> *mut u8 { + if count == 0 || size == 0 { + return ptr::null_mut(); + } + + let total_size = count.checked_mul(size).expect("overflow"); + + let total_size = round_size(total_size); + + // Calculate the total allocated size including header + let alloc_size = HEADER_SIZE + total_size; + + let layout = if let Ok(layout) = Layout::from_size_align(alloc_size, ALLOC_ALIGN) { + layout + } else { + return ptr::null_mut(); + }; + + let ptr = unsafe { alloc::alloc_zeroed(layout) }; + + if ptr.is_null() { + return ptr::null_mut(); + } + + let header = unsafe { &mut *(ptr as *mut Header) }; + header.size = total_size; + + let ptr = unsafe { ptr.add(HEADER_SIZE) }; + ptr + } + fn alloc(&mut self, size: usize) -> *mut u8 { let size = round_size(size); let alloc_size = size + HEADER_SIZE; @@ -110,6 +141,14 @@ mod test { } } + fn calloc(&mut self, count: usize, size: usize) -> *mut u8 { + unsafe { + let res = RustAllocator.calloc(count, size); + ALLOC_SIZE.fetch_add(RustAllocator::usable_size(res), Ordering::AcqRel); + res + } + } + unsafe fn dealloc(&mut self, ptr: *mut u8) { ALLOC_SIZE.fetch_sub(RustAllocator::usable_size(ptr), Ordering::AcqRel); RustAllocator.dealloc(ptr); diff --git a/core/src/class.rs b/core/src/class.rs index 6e6e36e3..7165e01a 100644 --- a/core/src/class.rs +++ b/core/src/class.rs @@ -145,7 +145,7 @@ impl<'js, C: JsClass<'js>> Class<'js, C> { /// /// Returns `None` if the class is not yet registered or if the class doesn't have a prototype. pub fn prototype(ctx: &Ctx<'js>) -> Result>> { - unsafe { ctx.get_opaque().get_or_insert_prototype::(&ctx) } + unsafe { ctx.get_opaque().get_or_insert_prototype::(ctx) } } /// Create a constructor for the current class using its definition. diff --git a/core/src/context/async.rs b/core/src/context/async.rs index adb297c7..8c31de20 100644 --- a/core/src/context/async.rs +++ b/core/src/context/async.rs @@ -1,5 +1,8 @@ use super::{intrinsic, r#ref::ContextRef, ContextBuilder, Intrinsic}; -use crate::{markers::ParallelSend, qjs, runtime::AsyncRuntime, Ctx, Error, Result}; +use crate::{ + context::ctx::RefCountHeader, markers::ParallelSend, qjs, runtime::AsyncRuntime, Ctx, Error, + Result, +}; use std::{future::Future, mem, pin::Pin, ptr::NonNull}; mod future; @@ -108,7 +111,7 @@ impl Drop for Inner { None => { #[cfg(not(feature = "parallel"))] { - let p = unsafe { &mut *(self.ctx.as_ptr() as *mut qjs::JSRefCountHeader) }; + let p = unsafe { &mut *(self.ctx.as_ptr() as *mut RefCountHeader) }; if p.ref_count <= 1 { // Lock was poisoned, this should only happen on a panic. // We should still free the context. @@ -202,15 +205,6 @@ impl AsyncContext { ContextBuilder::default() } - pub async fn enable_big_num_ext(&self, enable: bool) { - let guard = self.0.rt.inner.lock().await; - guard.runtime.update_stack_top(); - unsafe { qjs::JS_EnableBignumExt(self.0.ctx.as_ptr(), i32::from(enable)) } - // Explicitly drop the guard to ensure it is valid during the entire use of runtime - guard.drop_pending(); - mem::drop(guard) - } - /// Returns the associated runtime pub fn runtime(&self) -> &AsyncRuntime { &self.0.rt diff --git a/core/src/context/base.rs b/core/src/context/base.rs index 7f1949a9..dc003df9 100644 --- a/core/src/context/base.rs +++ b/core/src/context/base.rs @@ -1,4 +1,4 @@ -use super::{intrinsic, r#ref::ContextRef, ContextBuilder, Intrinsic}; +use super::{ctx::RefCountHeader, intrinsic, r#ref::ContextRef, ContextBuilder, Intrinsic}; use crate::{qjs, Ctx, Error, Result, Runtime}; use std::{mem, ptr::NonNull}; @@ -84,14 +84,6 @@ impl Context { ContextBuilder::default() } - pub fn enable_big_num_ext(&self, enable: bool) { - let guard = self.0.rt.inner.lock(); - guard.update_stack_top(); - unsafe { qjs::JS_EnableBignumExt(self.0.ctx.as_ptr(), i32::from(enable)) } - // Explicitly drop the guard to ensure it is valid during the entire use of runtime - mem::drop(guard) - } - /// Returns the associated runtime pub fn runtime(&self) -> &Runtime { &self.0.rt @@ -127,7 +119,7 @@ impl Drop for Context { let guard = match self.0.rt.inner.try_lock() { Some(x) => x, None => { - let p = unsafe { &mut *(self.0.ctx.as_ptr() as *mut qjs::JSRefCountHeader) }; + let p = unsafe { &mut *(self.0.ctx.as_ptr() as *mut RefCountHeader) }; if p.ref_count <= 1 { // Lock was poisoned, this should only happen on a panic. // We should still free the context. @@ -253,9 +245,10 @@ mod test { println!("done"); } + // Will be improved by https://github.com/quickjs-ng/quickjs/pull/406 #[test] #[should_panic( - expected = "Error:[eval_script]:1:4 invalid first character of private name\n at eval_script:1:4\n" + expected = "Error: invalid first character of private name\n at eval_script:1:1\n" )] fn exception() { test_with(|ctx| { diff --git a/core/src/context/builder.rs b/core/src/context/builder.rs index 670f0635..a5141f8c 100644 --- a/core/src/context/builder.rs +++ b/core/src/context/builder.rs @@ -56,8 +56,6 @@ pub mod intrinsic { Date JS_AddIntrinsicDate, /// Add evaluation support Eval JS_AddIntrinsicEval, - /// Add string normalization - StringNormalize JS_AddIntrinsicStringNormalize, /// Add RegExp compiler RegExpCompiler JS_AddIntrinsicRegExpCompiler, /// Add RegExp object support @@ -74,14 +72,10 @@ pub mod intrinsic { Promise JS_AddIntrinsicPromise, /// Add BigInt support BigInt JS_AddIntrinsicBigInt, - /// Add BigFloat support - BigFloat JS_AddIntrinsicBigFloat, - /// Add BigDecimal support - BigDecimal JS_AddIntrinsicBigDecimal, - /// Add operator overloading support - Operators JS_AddIntrinsicOperators, - /// Enable bignum extension - BignumExt JS_EnableBignumExt (1), + /// Add Performance support + Performance JS_AddPerformance, + /// Add WeakRef support + WeakRef JS_AddIntrinsicWeakRef, } /// An alias for [`BaseObjects`] @@ -94,7 +88,6 @@ pub mod intrinsic { pub type All = ( Date, Eval, - StringNormalize, RegExpCompiler, RegExp, Json, @@ -103,10 +96,8 @@ pub mod intrinsic { TypedArrays, Promise, BigInt, - BigFloat, - BigDecimal, - Operators, - BignumExt, + Performance, + WeakRef, ); } diff --git a/core/src/context/ctx.rs b/core/src/context/ctx.rs index 66dc5e26..79abc1e6 100644 --- a/core/src/context/ctx.rs +++ b/core/src/context/ctx.rs @@ -93,6 +93,11 @@ impl<'js> Drop for Ctx<'js> { unsafe impl Send for Ctx<'_> {} +#[repr(C)] // Ensure C-compatible memory layout +pub(crate) struct RefCountHeader { + pub ref_count: i32, // `int` in C is usually equivalent to `i32` in Rust +} + impl<'js> Ctx<'js> { pub(crate) fn as_ptr(&self) -> *mut qjs::JSContext { self.ctx.as_ptr() @@ -243,18 +248,6 @@ impl<'js> Ctx<'js> { /// Parse json into a JavaScript value. pub fn json_parse(&self, json: S) -> Result> - where - S: Into>, - { - self.json_parse_ext(json, false) - } - - /// Parse json into a JavaScript value, possibly allowing extended syntax support. - /// - /// If `allow_extensions` is `true`, this function will allow extended json syntax. - /// Extended syntax allows comments, single quoted strings, non string property names, trailing - /// comma's and hex, oct and binary numbers. - pub fn json_parse_ext(&self, json: S, allow_extensions: bool) -> Result> where S: Into>, { @@ -262,18 +255,12 @@ impl<'js> Ctx<'js> { let len = src.len(); let src = CString::new(src)?; unsafe { - let flag = if allow_extensions { - qjs::JS_PARSE_JSON_EXT as i32 - } else { - 0i32 - }; let name = b"\0"; - let v = qjs::JS_ParseJSON2( + let v = qjs::JS_ParseJSON( self.as_ptr(), src.as_ptr().cast(), len.try_into().expect(qjs::SIZE_T_ERROR), name.as_ptr().cast(), - flag, ); self.handle_exception(v)?; Ok(Value::from_js_value(self.clone(), v)) @@ -547,7 +534,7 @@ mod test { } #[test] - #[should_panic(expected = "'foo' is not defined")] + #[should_panic(expected = "foo is not defined")] fn eval_with_sloppy_code() { use crate::{CatchResultExt, Context, Runtime}; @@ -599,7 +586,7 @@ mod test { } #[test] - #[should_panic(expected = "'foo' is not defined")] + #[should_panic(expected = "foo is not defined")] fn eval_with_options_strict_sloppy_code() { use crate::{context::EvalOptions, CatchResultExt, Context, Runtime}; @@ -646,29 +633,6 @@ mod test { }) } - #[test] - fn json_parse_extension() { - use crate::{Array, Context, Object, Runtime}; - - let runtime = Runtime::new().unwrap(); - let ctx = Context::full(&runtime).unwrap(); - ctx.with(|ctx| { - let v = ctx - .json_parse_ext( - r#"{ a: { "b": 0xf, "c": 0b11 }, "d": [0o17,'foo'], }"#, - true, - ) - .unwrap(); - let obj = v.into_object().unwrap(); - let inner_obj: Object = obj.get("a").unwrap(); - assert_eq!(inner_obj.get::<_, i32>("b").unwrap(), 0xf); - assert_eq!(inner_obj.get::<_, i32>("c").unwrap(), 0b11); - let inner_array: Array = obj.get("d").unwrap(); - assert_eq!(inner_array.get::(0).unwrap(), 0o17); - assert_eq!(inner_array.get::(1).unwrap(), "foo".to_string()); - }) - } - #[test] fn json_stringify() { use crate::{Array, Context, Object, Runtime}; diff --git a/core/src/loader/compile.rs b/core/src/loader/compile.rs index 0811498b..b82711e0 100644 --- a/core/src/loader/compile.rs +++ b/core/src/loader/compile.rs @@ -173,10 +173,9 @@ where R: Resolver, { fn resolve<'js>(&mut self, ctx: &Ctx<'js>, base: &str, name: &str) -> Result { - self.inner.resolve(ctx, base, name).map(|path| { + self.inner.resolve(ctx, base, name).inspect(|path| { let name = resolve_simple(base, name); self.data.lock().modules.insert(path.clone(), name); - path }) } } diff --git a/core/src/runtime/base.rs b/core/src/runtime/base.rs index 28b8736f..b61a6445 100644 --- a/core/src/runtime/base.rs +++ b/core/src/runtime/base.rs @@ -124,6 +124,13 @@ impl Runtime { } } + /// Set debug flags for dumping memory + pub fn set_dump_flags(&self, flags: u64) { + unsafe { + self.inner.lock().set_dump_flags(flags); + } + } + /// Manually run the garbage collection. /// /// Most of QuickJS values are reference counted and diff --git a/core/src/runtime/opaque.rs b/core/src/runtime/opaque.rs index 0ce81511..7a172999 100644 --- a/core/src/runtime/opaque.rs +++ b/core/src/runtime/opaque.rs @@ -76,8 +76,8 @@ impl<'js> Opaque<'js> { } pub unsafe fn initialize(&mut self, rt: *mut qjs::JSRuntime) -> Result<(), Error> { - qjs::JS_NewClassID((&mut self.class_id) as *mut qjs::JSClassID); - qjs::JS_NewClassID((&mut self.callable_class_id) as *mut qjs::JSClassID); + qjs::JS_NewClassID(rt, (&mut self.class_id) as *mut qjs::JSClassID); + qjs::JS_NewClassID(rt, (&mut self.callable_class_id) as *mut qjs::JSClassID); let class_def = qjs::JSClassDef { class_name: b"RustClass\0".as_ptr().cast(), diff --git a/core/src/runtime/raw.rs b/core/src/runtime/raw.rs index 1d6b041e..da6ca9ab 100644 --- a/core/src/runtime/raw.rs +++ b/core/src/runtime/raw.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] use std::{ ffi::CString, mem, @@ -17,6 +18,94 @@ use crate::{ use super::{opaque::Opaque, InterruptHandler}; +const DUMP_BYTECODE_FINAL: u64 = 0x01; +const DUMP_BYTECODE_PASS2: u64 = 0x02; +const DUMP_BYTECODE_PASS1: u64 = 0x04; +const DUMP_BYTECODE_HEX: u64 = 0x10; +const DUMP_BYTECODE_PC2LINE: u64 = 0x20; +const DUMP_BYTECODE_STACK: u64 = 0x40; +const DUMP_BYTECODE_STEP: u64 = 0x80; +const DUMP_READ_OBJECT: u64 = 0x100; +const DUMP_FREE: u64 = 0x200; +const DUMP_GC: u64 = 0x400; +const DUMP_GC_FREE: u64 = 0x800; +const DUMP_MODULE_RESOLVE: u64 = 0x1000; +const DUMP_PROMISE: u64 = 0x2000; +const DUMP_LEAKS: u64 = 0x4000; +const DUMP_ATOM_LEAKS: u64 = 0x8000; +const DUMP_MEM: u64 = 0x10000; +const DUMP_OBJECTS: u64 = 0x20000; +const DUMP_ATOMS: u64 = 0x40000; +const DUMP_SHAPES: u64 = 0x80000; + +// Build the flags using `#[cfg]` at compile time +const fn build_dump_flags() -> u64 { + #[allow(unused_mut)] + let mut flags: u64 = 0; + + #[cfg(feature = "dump-bytecode")] + { + flags |= DUMP_BYTECODE_FINAL | DUMP_BYTECODE_PASS2 | DUMP_BYTECODE_PASS1; + } + + #[cfg(feature = "dump-gc")] + { + flags |= DUMP_GC; + } + + #[cfg(feature = "dump-gc-free")] + { + flags |= DUMP_GC_FREE; + } + + #[cfg(feature = "dump-free")] + { + flags |= DUMP_FREE; + } + + #[cfg(feature = "dump-leaks")] + { + flags |= DUMP_LEAKS; + } + + #[cfg(feature = "dump-mem")] + { + flags |= DUMP_MEM; + } + + #[cfg(feature = "dump-objects")] + { + flags |= DUMP_OBJECTS; + } + + #[cfg(feature = "dump-atoms")] + { + flags |= DUMP_ATOMS; + } + + #[cfg(feature = "dump-shapes")] + { + flags |= DUMP_SHAPES; + } + + #[cfg(feature = "dump-module-resolve")] + { + flags |= DUMP_MODULE_RESOLVE; + } + + #[cfg(feature = "dump-promise")] + { + flags |= DUMP_PROMISE; + } + + #[cfg(feature = "dump-read-object")] + { + flags |= DUMP_READ_OBJECT; + } + + flags +} + #[derive(Debug)] pub(crate) struct RawRuntime { pub(crate) rt: NonNull, @@ -60,6 +149,9 @@ impl RawRuntime { #[allow(dead_code)] pub unsafe fn new_base(mut opaque: Opaque<'static>) -> Result { let rt = qjs::JS_NewRuntime(); + + Self::add_dump_flags(rt); + let rt = NonNull::new(rt).ok_or(Error::Allocation)?; opaque.initialize(rt.as_ptr())?; @@ -87,6 +179,9 @@ impl RawRuntime { let opaque_ptr = allocator.opaque_ptr(); let rt = qjs::JS_NewRuntime2(&functions, opaque_ptr as _); + + Self::add_dump_flags(rt); + let rt = NonNull::new(rt).ok_or(Error::Allocation)?; opaque.initialize(rt.as_ptr())?; @@ -173,6 +268,11 @@ impl RawRuntime { qjs::JS_SetGCThreshold(self.rt.as_ptr(), threshold as _); } + /// Set dump flags. + pub unsafe fn set_dump_flags(&self, flags: u64) { + qjs::JS_SetDumpFlags(self.rt.as_ptr(), flags); + } + /// Manually run the garbage collection. /// /// Most of QuickJS values are reference counted and @@ -224,4 +324,10 @@ impl RawRuntime { ); self.get_opaque().set_interrupt_handler(handler); } + + fn add_dump_flags(rt: *mut rquickjs_sys::JSRuntime) { + unsafe { + qjs::JS_SetDumpFlags(rt, build_dump_flags()); + } + } } diff --git a/core/src/value.rs b/core/src/value.rs index 88915d06..ecb182b3 100644 --- a/core/src/value.rs +++ b/core/src/value.rs @@ -67,7 +67,7 @@ impl<'js> Hash for Value<'js> { impl<'js> Clone for Value<'js> { fn clone(&self) -> Self { let ctx = self.ctx.clone(); - let value = unsafe { qjs::JS_DupValue(self.value) }; + let value = unsafe { qjs::JS_DupValue(ctx.as_ptr(), self.value) }; Self { ctx, value } } } @@ -131,7 +131,7 @@ impl<'js> Value<'js> { #[inline] pub(crate) unsafe fn from_js_value_const(ctx: Ctx<'js>, value: qjs::JSValueConst) -> Self { - let value = qjs::JS_DupValue(value); + let value = qjs::JS_DupValue(ctx.as_ptr(), value); Self { ctx, value } } @@ -271,7 +271,7 @@ impl<'js> Value<'js> { #[allow(unused)] #[inline] pub(crate) fn new_ptr_const(ctx: Ctx<'js>, tag: qjs::c_int, ptr: *mut qjs::c_void) -> Self { - let value = unsafe { qjs::JS_DupValue(qjs::JS_MKPTR(tag, ptr)) }; + let value = unsafe { qjs::JS_DupValue(ctx.as_ptr(), qjs::JS_MKPTR(tag, ptr)) }; Self { ctx, value } } diff --git a/core/src/value/atom/predefined.rs b/core/src/value/atom/predefined.rs index 775fbeab..9ca51109 100644 --- a/core/src/value/atom/predefined.rs +++ b/core/src/value/atom/predefined.rs @@ -105,12 +105,6 @@ pub enum PredefinedAtom { Empty = qjs::JS_ATOM_empty_string as u32, /// "length" Length = qjs::JS_ATOM_length as u32, - /// "fileName" - FileName = qjs::JS_ATOM_fileName as u32, - /// "lineNumber" - LineNumber = qjs::JS_ATOM_lineNumber as u32, - /// "columnNumber - ColumnNumber = qjs::JS_ATOM_columnNumber as u32, /// "message" Message = qjs::JS_ATOM_message as u32, /// "errors" @@ -279,16 +273,6 @@ pub enum PredefinedAtom { GlobalThis = qjs::JS_ATOM_globalThis as u32, /// "bigint" Bigint = qjs::JS_ATOM_bigint as u32, - /// "bigfloat" - Bigfloat = qjs::JS_ATOM_bigfloat as u32, - /// "bigdecimal" - Bigdecimal = qjs::JS_ATOM_bigdecimal as u32, - /// "roundingMode" - RoundingMode = qjs::JS_ATOM_roundingMode as u32, - /// "maximumSignificantDigits" - MaximumSignificantDigits = qjs::JS_ATOM_maximumSignificantDigits as u32, - /// "maximumFractionDigits" - MaximumFractionDigits = qjs::JS_ATOM_maximumFractionDigits as u32, /// "toJSON" ToJSON = qjs::JS_ATOM_toJSON as u32, /// "Object" @@ -351,16 +335,6 @@ pub enum PredefinedAtom { DataView = qjs::JS_ATOM_DataView as u32, /// "BigInt" BigInt = qjs::JS_ATOM_BigInt as u32, - /// "BigFloat" - BigFloat = qjs::JS_ATOM_BigFloat as u32, - /// "BigFloatEnv" - BigFloatEnv = qjs::JS_ATOM_BigFloatEnv as u32, - /// "BigDecimal" - BigDecimal = qjs::JS_ATOM_BigDecimal as u32, - /// "OperatorSet" - OperatorSet = qjs::JS_ATOM_OperatorSet as u32, - /// "Operators" - Operators = qjs::JS_ATOM_Operators as u32, /// "Map" Map = qjs::JS_ATOM_Map as u32, /// "Set" @@ -508,9 +482,6 @@ impl PredefinedAtom { PredefinedAtom::Await => "await", PredefinedAtom::Empty => "", PredefinedAtom::Length => "length", - PredefinedAtom::FileName => "fileName", - PredefinedAtom::LineNumber => "lineNumber", - PredefinedAtom::ColumnNumber => "columnNumber", PredefinedAtom::Message => "message", PredefinedAtom::Errors => "errors", PredefinedAtom::Stack => "stack", @@ -595,11 +566,6 @@ impl PredefinedAtom { PredefinedAtom::Reason => "reason", PredefinedAtom::GlobalThis => "globalThis", PredefinedAtom::Bigint => "bigint", - PredefinedAtom::Bigfloat => "bigfloat", - PredefinedAtom::Bigdecimal => "bigdecimal", - PredefinedAtom::RoundingMode => "roundingMode", - PredefinedAtom::MaximumSignificantDigits => "maximumSignificantDigits", - PredefinedAtom::MaximumFractionDigits => "maximumFractionDigits", PredefinedAtom::ToJSON => "toJSON", PredefinedAtom::Object => "Object", PredefinedAtom::Array => "Array", @@ -631,11 +597,6 @@ impl PredefinedAtom { PredefinedAtom::Float64Array => "Float64Array", PredefinedAtom::DataView => "DataView", PredefinedAtom::BigInt => "BigInt", - PredefinedAtom::BigFloat => "BigFloat", - PredefinedAtom::BigFloatEnv => "BigFloatEnv", - PredefinedAtom::BigDecimal => "BigDecimal", - PredefinedAtom::OperatorSet => "OperatorSet", - PredefinedAtom::Operators => "Operators", PredefinedAtom::Map => "Map", PredefinedAtom::Set => "Set", PredefinedAtom::WeakMap => "WeakMap", @@ -734,8 +695,6 @@ mod test { PredefinedAtom::Await, PredefinedAtom::Empty, PredefinedAtom::Length, - PredefinedAtom::FileName, - PredefinedAtom::LineNumber, PredefinedAtom::Message, PredefinedAtom::Errors, PredefinedAtom::Stack, @@ -820,11 +779,6 @@ mod test { PredefinedAtom::Reason, PredefinedAtom::GlobalThis, PredefinedAtom::Bigint, - PredefinedAtom::Bigfloat, - PredefinedAtom::Bigdecimal, - PredefinedAtom::RoundingMode, - PredefinedAtom::MaximumSignificantDigits, - PredefinedAtom::MaximumFractionDigits, PredefinedAtom::ToJSON, PredefinedAtom::Object, PredefinedAtom::Array, @@ -856,11 +810,6 @@ mod test { PredefinedAtom::Float64Array, PredefinedAtom::DataView, PredefinedAtom::BigInt, - PredefinedAtom::BigFloat, - PredefinedAtom::BigFloatEnv, - PredefinedAtom::BigDecimal, - PredefinedAtom::OperatorSet, - PredefinedAtom::Operators, PredefinedAtom::Map, PredefinedAtom::Set, PredefinedAtom::WeakMap, diff --git a/core/src/value/convert.rs b/core/src/value/convert.rs index e01961a8..dd240cf0 100644 --- a/core/src/value/convert.rs +++ b/core/src/value/convert.rs @@ -22,9 +22,6 @@ mod into; /// assert_eq!(ctx.eval::, _>("({})")?.0, "[object Object]"); /// /// // Coercion to integer -/// assert!(ctx.eval::("123.5").is_err()); -/// assert_eq!(ctx.eval::, _>("123.5")?.0, 123); -/// /// assert!(ctx.eval::("`123`").is_err()); /// assert_eq!(ctx.eval::, _>("`123`")?.0, 123); /// diff --git a/core/src/value/convert/from.rs b/core/src/value/convert/from.rs index b14c2d2c..e682ff5b 100644 --- a/core/src/value/convert/from.rs +++ b/core/src/value/convert/from.rs @@ -270,7 +270,7 @@ from_js_impls! { from_js_impls! { val: bool => Bool get_bool, - i32 => Int get_int, + i32 => Float get_float Int get_int, f64 => Float get_float Int get_int, } diff --git a/core/src/value/exception.rs b/core/src/value/exception.rs index a1babefc..b444322e 100644 --- a/core/src/value/exception.rs +++ b/core/src/value/exception.rs @@ -15,9 +15,6 @@ impl fmt::Debug for Exception<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Exception") .field("message", &self.message()) - .field("file", &self.file()) - .field("line", &self.line()) - .field("column", &self.column()) .field("stack", &self.stack()) .finish() } @@ -69,60 +66,11 @@ impl<'js> Exception<'js> { Ok(Exception(obj)) } - /// Creates a new exception with a given message, file name and line number. - pub fn from_message_location( - ctx: Ctx<'js>, - message: &str, - file: &str, - line: i32, - ) -> Result { - let obj = unsafe { - let value = ctx.handle_exception(qjs::JS_NewError(ctx.as_ptr()))?; - Value::from_js_value(ctx, value) - .into_object() - .expect("`JS_NewError` did not return an object") - }; - obj.set(PredefinedAtom::Message, message)?; - obj.set(PredefinedAtom::FileName, file)?; - obj.set(PredefinedAtom::LineNumber, line)?; - Ok(Exception(obj)) - } - /// Returns the message of the error. /// /// Same as retrieving `error.message` in JavaScript. pub fn message(&self) -> Option { - self.get::<_, Option>>("message") - .ok() - .and_then(|x| x) - .map(|x| x.0) - } - - /// Returns the file name from with the error originated.. - /// - /// Same as retrieving `error.fileName` in JavaScript. - pub fn file(&self) -> Option { - self.get::<_, Option>>(PredefinedAtom::FileName) - .ok() - .and_then(|x| x) - .map(|x| x.0) - } - - /// Returns the file line from with the error originated.. - /// - /// Same as retrieving `error.lineNumber` in JavaScript. - pub fn line(&self) -> Option { - self.get::<_, Option>>(PredefinedAtom::LineNumber) - .ok() - .and_then(|x| x) - .map(|x| x.0) - } - - /// Returns the file line from with the error originated.. - /// - /// Same as retrieving `error.lineNumber` in JavaScript. - pub fn column(&self) -> Option { - self.get::<_, Option>>(PredefinedAtom::ColumnNumber) + self.get::<_, Option>>(PredefinedAtom::Message) .ok() .and_then(|x| x) .map(|x| x.0) @@ -157,12 +105,6 @@ impl<'js> Exception<'js> { let (Ok(e) | Err(e)) = Self::from_message(ctx.clone(), message).map(|x| x.throw()); e } - /// Throws a new generic error with a file name and line number. - pub fn throw_message_location(ctx: &Ctx<'js>, message: &str, file: &str, line: i32) -> Error { - let (Ok(e) | Err(e)) = - Self::from_message_location(ctx.clone(), message, file, line).map(|x| x.throw()); - e - } /// Throws a new syntax error. pub fn throw_syntax(ctx: &Ctx<'js>, message: &str) -> Error { @@ -274,27 +216,6 @@ impl<'js> Exception<'js> { impl fmt::Display for Exception<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { "Error:".fmt(f)?; - let mut has_file = false; - if let Some(file) = self.file() { - '['.fmt(f)?; - file.fmt(f)?; - ']'.fmt(f)?; - has_file = true; - } - if let Some(line) = self.line() { - if line > -1 { - if has_file { - ':'.fmt(f)?; - } - line.fmt(f)?; - } - } - if let Some(column) = self.column() { - if column > -1 { - ':'.fmt(f)?; - column.fmt(f)?; - } - } if let Some(message) = self.message() { ' '.fmt(f)?; message.fmt(f)?; diff --git a/core/src/value/function.rs b/core/src/value/function.rs index 88786c6b..20a7662b 100644 --- a/core/src/value/function.rs +++ b/core/src/value/function.rs @@ -151,7 +151,7 @@ impl<'js> Function<'js> { /// `Function.prototype`. pub fn prototype(ctx: Ctx<'js>) -> Object<'js> { let res = unsafe { - let v = qjs::JS_DupValue(qjs::JS_GetFunctionProto(ctx.as_ptr())); + let v = qjs::JS_GetFunctionProto(ctx.as_ptr()); Value::from_js_value(ctx, v) }; // as far is I know this should always be an object. diff --git a/core/src/value/module.rs b/core/src/value/module.rs index 10bc7dc3..9bc58f3f 100644 --- a/core/src/value/module.rs +++ b/core/src/value/module.rs @@ -301,7 +301,7 @@ impl<'js> Module<'js, Declared> { let ret = unsafe { // JS_EvalFunction `free's` the module so we should dup first let v = qjs::JS_MKPTR(qjs::JS_TAG_MODULE, self.ptr.as_ptr().cast()); - qjs::JS_DupValue(v); + qjs::JS_DupValue(self.ctx.as_ptr(), v); qjs::JS_EvalFunction(self.ctx.as_ptr(), v) }; let ret = unsafe { self.ctx.handle_exception(ret)? }; diff --git a/core/src/value/symbol.rs b/core/src/value/symbol.rs index 540f75ed..75fbb788 100644 --- a/core/src/value/symbol.rs +++ b/core/src/value/symbol.rs @@ -65,8 +65,6 @@ impl_symbols! { unscopables => JS_ATOM_Symbol_unscopables /// returns the symbol for `asyncIterator` async_iterator => JS_ATOM_Symbol_asyncIterator - /// returns the symbol for `operatorSet` - operator_set => JS_ATOM_Symbol_operatorSet } #[cfg(test)] diff --git a/examples/rquickjs-cli/src/main.rs b/examples/rquickjs-cli/src/main.rs index 97aba738..44dc9fc7 100644 --- a/examples/rquickjs-cli/src/main.rs +++ b/examples/rquickjs-cli/src/main.rs @@ -33,17 +33,10 @@ globalThis.console = { print!("> "); std::io::stdout().flush()?; std::io::stdin().read_line(&mut input)?; - match ctx.eval::(input.as_bytes()).catch(&ctx) { - Ok(ret) => match js_log.call::<(Value<'_>,), ()>((ret,)) { - Err(err) => { - println!("{err}") - } - Ok(_) => {} - }, - Err(err) => { - println!("{err}"); - } - } + ctx.eval::(input.as_bytes()) + .and_then(|ret| js_log.call::<(Value<'_>,), ()>((ret,))) + .catch(&ctx) + .unwrap_or_else(|err| println!("{err}")); } })?; diff --git a/macro/src/js_lifetime.rs b/macro/src/js_lifetime.rs index 1064cd69..f87f0b3c 100644 --- a/macro/src/js_lifetime.rs +++ b/macro/src/js_lifetime.rs @@ -14,14 +14,11 @@ use crate::{ pub fn retrieve_lifetime(generics: &Generics) -> Result> { let mut lifetime: Option<&Lifetime> = None; for p in generics.params.iter() { - match p { - GenericParam::Lifetime(x) => { - if let Some(x) = lifetime.as_ref() { - return Err(Error::new(x.span(),"Type has multiple lifetimes, this is not supported by the JsLifetime derive macro")); - } - lifetime = Some(&x.lifetime); + if let GenericParam::Lifetime(x) = p { + if let Some(x) = lifetime.as_ref() { + return Err(Error::new(x.span(),"Type has multiple lifetimes, this is not supported by the JsLifetime derive macro")); } - _ => {} + lifetime = Some(&x.lifetime); } } @@ -34,7 +31,7 @@ pub fn extract_types_need_checking(lt: &Lifetime, data: &Data) -> Result { for f in s.fields.iter() { - extract_types_need_checking_fields(lt, &f, &mut res)?; + extract_types_need_checking_fields(lt, f, &mut res)?; } } Data::Enum(e) => { @@ -46,7 +43,7 @@ pub fn extract_types_need_checking(lt: &Lifetime, data: &Data) -> Result Visit<'ast> for LtTypeVisitor<'ast> { return; } - match i { - GenericArgument::Lifetime(lt) => { - if lt.ident == "static" || lt == self.1 { - self.0 = Ok(true) - } else { - self.0 = Err(Error::new( - lt.span(), - "Type contained lifetime which was not static or the 'js lifetime", - )); - } + if let GenericArgument::Lifetime(lt) = i { + if lt.ident == "static" || lt == self.1 { + self.0 = Ok(true) + } else { + self.0 = Err(Error::new( + lt.span(), + "Type contained lifetime which was not static or the 'js lifetime", + )); } - _ => {} } syn::visit::visit_generic_argument(self, i); @@ -160,7 +154,7 @@ pub(crate) fn expand(mut input: DeriveInput) -> Result { return Ok(res); }; - let types = extract_types_need_checking(<, &input.data)?; + let types = extract_types_need_checking(lt, &input.data)?; let const_name = format_ident!("__{}__LT_TYPE_CHECK", name.to_string().to_uppercase()); diff --git a/macro/src/lib.rs b/macro/src/lib.rs index 7ed5c78e..1f9dc636 100644 --- a/macro/src/lib.rs +++ b/macro/src/lib.rs @@ -137,14 +137,12 @@ pub fn function(attr: TokenStream1, item: TokenStream1) -> TokenStream1 { Ok(x) => x.into(), Err(e) => e.into_compile_error().into(), }, - item => { - return Error::new( - item.span(), - "#[function] macro can only be used on functions", - ) - .into_compile_error() - .into() - } + item => Error::new( + item.span(), + "#[function] macro can only be used on functions", + ) + .into_compile_error() + .into(), } } @@ -298,14 +296,12 @@ pub fn methods(attr: TokenStream1, item: TokenStream1) -> TokenStream1 { Ok(x) => x.into(), Err(e) => e.into_compile_error().into(), }, - item => { - return Error::new( - item.span(), - "#[methods] macro can only be used on impl blocks", - ) - .into_compile_error() - .into() - } + item => Error::new( + item.span(), + "#[methods] macro can only be used on impl blocks", + ) + .into_compile_error() + .into(), } } @@ -483,11 +479,9 @@ pub fn module(attr: TokenStream1, item: TokenStream1) -> TokenStream1 { Ok(x) => x.into(), Err(e) => e.into_compile_error().into(), }, - item => { - return Error::new(item.span(), "#[module] macro can only be used on modules") - .into_compile_error() - .into() - } + item => Error::new(item.span(), "#[module] macro can only be used on modules") + .into_compile_error() + .into(), } } diff --git a/sys/Makefile b/sys/Makefile index 684f056f..21b9b8bc 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -3,20 +3,8 @@ patch = all #hotfix msvc exports $(info patch = $(patch)) ifneq ($(filter hotfix all,$(patch)),) -PATCHES += error_column_number PATCHES += get_function_proto PATCHES += check_stack_overflow -PATCHES += infinity_handling -PATCHES += atomic_new_class_id -PATCHES += dynamic_import_sync -endif - -ifneq ($(filter msvc all,$(patch)),) -PATCHES += basic_msvc_compat -endif - -ifneq ($(filter exports all,$(patch)),) -PATCHES += read_module_exports endif # apply patches diff --git a/sys/build.rs b/sys/build.rs index b425e966..03039dfd 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -1,8 +1,7 @@ use std::{ env, fs, - io::Write, path::{Path, PathBuf}, - process::{self, Command, Stdio}, + process::{self}, }; // WASI logic lifted from https://github.com/bytecodealliance/javy/blob/61616e1507d2bf896f46dc8d72687273438b58b2/crates/quickjs-wasm-sys/build.rs#L18 @@ -116,7 +115,6 @@ fn main() { } let src_dir = Path::new("quickjs"); - let patches_dir = Path::new("patches"); let out_dir = env::var("OUT_DIR").expect("No OUT_DIR env var is set by cargo"); let out_dir = Path::new(&out_dir); @@ -130,6 +128,7 @@ fn main() { "list.h", "quickjs-atom.h", "quickjs-opcode.h", + "quickjs-c-atomics.h", "quickjs.h", "cutils.h", ]; @@ -142,36 +141,30 @@ fn main() { "libbf.c", ]; - let mut patch_files = vec![ - "error_column_number.patch", - "get_function_proto.patch", - "check_stack_overflow.patch", - "infinity_handling.patch", - ]; + let mut defines: Vec<(String, Option<&str>)> = vec![("_GNU_SOURCE".into(), None)]; - let version = - fs::read_to_string(src_dir.join("VERSION")).expect("failed to read quickjs VERSION file"); - let version = format!("\"{}\"", version.trim()); + let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap(); + let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap(); - let mut defines = vec![ - ("_GNU_SOURCE".into(), None), - ("CONFIG_VERSION".into(), Some(version.as_str())), - ("CONFIG_BIGNUM".into(), None), - ]; + let mut builder = cc::Build::new(); + builder + .extra_warnings(false) + .flag_if_supported("-Wno-implicit-const-int-float-conversion") + //.flag("-Wno-array-bounds") + //.flag("-Wno-format-truncation") + ; - if env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows" - && env::var("CARGO_CFG_TARGET_ENV").unwrap() == "msvc" - { - patch_files.push("basic_msvc_compat.patch"); - } + let mut bindgen_cflags = vec![]; - for feature in &features { - if feature.starts_with("dump-") && env::var(feature_to_cargo(feature)).is_ok() { - defines.push((feature_to_define(feature), None)); + if target_os == "windows" { + if target_env == "msvc" { + env::set_var("CFLAGS", "/std:c11 /experimental:c11atomics"); + } else { + env::set_var("CFLAGS", "-std=c11"); } } - if env::var("CARGO_CFG_TARGET_OS").unwrap() == "wasi" { + if target_os == "wasi" { // pretend we're emscripten - there are already ifdefs that match // also, wasi doesn't ahve FE_DOWNWARD or FE_UPWARD defines.push(("EMSCRIPTEN".into(), Some("1"))); @@ -185,13 +178,7 @@ fn main() { } fs::copy("quickjs.bind.h", out_dir.join("quickjs.bind.h")).expect("Unable to copy source"); - // applying patches - for file in &patch_files { - patch(out_dir, patches_dir.join(file)); - } - - let mut add_cflags = vec![]; - if env::var("CARGO_CFG_TARGET_OS").unwrap() == "wasi" { + if target_os == "wasi" { let wasi_sdk_path = get_wasi_sdk_path(); if !wasi_sdk_path.try_exists().unwrap() { panic!( @@ -206,7 +193,7 @@ fn main() { wasi_sdk_path.join("share/wasi-sysroot").display() ); env::set_var("CFLAGS", &sysroot); - add_cflags.push(sysroot); + bindgen_cflags.push(sysroot); } // generating bindings @@ -214,17 +201,9 @@ fn main() { out_dir, out_dir.join("quickjs.bind.h"), &defines, - add_cflags, + bindgen_cflags, ); - let mut builder = cc::Build::new(); - builder - .extra_warnings(false) - .flag_if_supported("-Wno-implicit-const-int-float-conversion") - //.flag("-Wno-array-bounds") - //.flag("-Wno-format-truncation") - ; - for (name, value) in &defines { builder.define(name, *value); } @@ -244,24 +223,6 @@ fn feature_to_define(name: impl AsRef) -> String { name.as_ref().to_uppercase().replace('-', "_") } -fn patch, P: AsRef>(out_dir: D, patch: P) { - let mut child = Command::new("patch") - .args(["-p1", "-f"]) - .stdin(Stdio::piped()) - .current_dir(out_dir) - .spawn() - .expect("Unable to execute patch, you may need to install it: {}"); - println!("Applying patch {}", patch.as_ref().display()); - { - let patch = fs::read(patch).expect("Unable to read patch"); - - let stdin = child.stdin.as_mut().unwrap(); - stdin.write_all(&patch).expect("Unable to apply patch"); - } - - child.wait_with_output().expect("Unable to apply patch"); -} - #[cfg(not(feature = "bindgen"))] fn bindgen<'a, D, H, X, K, V>(out_dir: D, _header_file: H, _defines: X, _add_cflags: Vec) where @@ -282,8 +243,9 @@ where .unwrap_or(false) { println!( - "cargo:warning=rquickjs probably doesn't ship bindings for platform `{}`. try the `bindgen` feature instead.", - target + "cargo:warning=rquickjs probably doesn't ship bindings for platform `{}({})`. try the `bindgen` feature instead.", + target, + env::var("BUILD_TARGET").unwrap_or("n/a".into()) ); } @@ -326,8 +288,6 @@ where }); } - println!("Bindings for target: {}", target); - let mut builder = bindgen_rs::Builder::default() .detect_include_paths(true) .clang_arg("-xc") diff --git a/sys/patches/basic_msvc_compat.patch b/sys/patches/basic_msvc_compat.patch deleted file mode 100644 index 3429ca1c..00000000 --- a/sys/patches/basic_msvc_compat.patch +++ /dev/null @@ -1,391 +0,0 @@ -diff --git a/cutils.c b/cutils.c -index c0aacef..c861f74 100644 ---- a/cutils.c -+++ b/cutils.c -@@ -29,6 +29,32 @@ - - #include "cutils.h" - -+#ifdef _MSC_VER -+#include -+#include -+ -+// From: https://stackoverflow.com/a/26085827 -+int gettimeofday(struct timeval *tvp, void *tzp) -+{ -+ (void)tzp; -+ static const uint64_t EPOCH = ((uint64_t)116444736000000000ULL); -+ -+ SYSTEMTIME system_time; -+ FILETIME file_time; -+ uint64_t time; -+ -+ GetSystemTime(&system_time); -+ SystemTimeToFileTime(&system_time, &file_time); -+ time = ((uint64_t)file_time.dwLowDateTime); -+ time += ((uint64_t)file_time.dwHighDateTime) << 32; -+ -+ tvp->tv_sec = (long)((time - EPOCH) / 10000000L); -+ tvp->tv_usec = (long)(system_time.wMilliseconds * 1000); -+ -+ return 0; -+} -+#endif -+ - void pstrcpy(char *buf, int buf_size, const char *str) - { - int c; -diff --git a/cutils.h b/cutils.h -index f079e5c..612220c 100644 ---- a/cutils.h -+++ b/cutils.h -@@ -28,12 +28,30 @@ - #include - #include - #include -+#ifdef _MSC_VER -+#include -+#include -+int gettimeofday(struct timeval *tvp, void *tzp); -+#else -+#include -+#endif - -+#ifndef __has_attribute -+#define likely(x) (x) -+#define unlikely(x) (x) -+#define force_inline __forceinline -+#define no_inline __declspec(noinline) -+#define __maybe_unused -+#define __attribute__(x) -+#define __attribute(x) -+typedef size_t ssize_t; -+#else - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) - #define force_inline inline __attribute__((always_inline)) - #define no_inline __attribute__((noinline)) - #define __maybe_unused __attribute__((unused)) -+#endif - - #define xglue(x, y) x ## y - #define glue(x, y) xglue(x, y) -@@ -128,27 +146,88 @@ static inline int64_t min_int64(int64_t a, int64_t b) - /* WARNING: undefined if a = 0 */ - static inline int clz32(unsigned int a) - { -+#ifdef _MSC_VER -+ unsigned long idx; -+ _BitScanReverse(&idx, a); -+ return 31 ^ idx; -+#else - return __builtin_clz(a); -+#endif - } - - /* WARNING: undefined if a = 0 */ - static inline int clz64(uint64_t a) - { -+#ifdef _MSC_VER -+ unsigned long idx; -+ // BitScanReverse scans from MSB to LSB for first set bit. -+ // Returns 0 if no set bit is found. -+# if INTPTR_MAX >= INT64_MAX // 64-bit -+ _BitScanReverse64(&idx, a); -+# else -+ // Scan the high 32 bits. -+ if (_BitScanReverse(&idx, (uint32_t)(a >> 32))) -+ return 63 ^ (idx + 32); -+ // Scan the low 32 bits. -+ _BitScanReverse(&idx, (uint32_t)(a)); -+# endif -+ return 63 ^ idx; -+#else - return __builtin_clzll(a); -+#endif - } - - /* WARNING: undefined if a = 0 */ - static inline int ctz32(unsigned int a) - { -+#ifdef _MSC_VER -+ unsigned long idx; -+ _BitScanForward(&idx, a); -+ return idx; -+#else - return __builtin_ctz(a); -+#endif - } - - /* WARNING: undefined if a = 0 */ - static inline int ctz64(uint64_t a) - { -+#ifdef _MSC_VER -+ unsigned long idx; -+ // Search from LSB to MSB for first set bit. -+ // Returns zero if no set bit is found. -+# if INTPTR_MAX >= INT64_MAX // 64-bit -+ _BitScanForward64(&idx, a); -+ return idx; -+# else -+ // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls. -+ // Scan the Low Word. -+ if (_BitScanForward(&idx, (uint32_t)(a))) -+ return idx; -+ // Scan the High Word. -+ _BitScanForward(&idx, (uint32_t)(a >> 32)); -+ return idx + 32; -+# endif -+#else - return __builtin_ctzll(a); -+#endif - } - -+#ifdef _MSC_VER -+#pragma pack(push, 1) -+struct packed_u64 { -+ uint64_t v; -+}; -+ -+struct packed_u32 { -+ uint32_t v; -+}; -+ -+struct packed_u16 { -+ uint16_t v; -+}; -+#pragma pack(pop) -+#else - struct __attribute__((packed)) packed_u64 { - uint64_t v; - }; -@@ -160,6 +239,7 @@ struct __attribute__((packed)) packed_u32 { - struct __attribute__((packed)) packed_u16 { - uint16_t v; - }; -+#endif - - static inline uint64_t get_u64(const uint8_t *tab) - { -diff --git a/libbf.h b/libbf.h -index a1436ab..65e111c 100644 ---- a/libbf.h -+++ b/libbf.h -@@ -27,7 +27,7 @@ - #include - #include - --#if defined(__SIZEOF_INT128__) && (INTPTR_MAX >= INT64_MAX) -+#if defined(__SIZEOF_INT128__) && (INTPTR_MAX >= INT64_MAX) && !defined(_MSC_VER) - #define LIMB_LOG2_BITS 6 - #else - #define LIMB_LOG2_BITS 5 -diff --git a/quickjs.c b/quickjs.c -index e8fdd8a..828e70f 100644 ---- a/quickjs.c -+++ b/quickjs.c -@@ -28,7 +28,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -48,7 +47,7 @@ - - #define OPTIMIZE 1 - #define SHORT_OPCODES 1 --#if defined(EMSCRIPTEN) -+#if defined(EMSCRIPTEN) || defined(_MSC_VER) - #define DIRECT_DISPATCH 0 - #else - #define DIRECT_DISPATCH 1 -@@ -67,11 +66,11 @@ - - /* define to include Atomics.* operations which depend on the OS - threads */ --#if !defined(EMSCRIPTEN) -+#if !defined(EMSCRIPTEN) && !defined(_MSC_VER) - #define CONFIG_ATOMICS - #endif - --#if !defined(EMSCRIPTEN) -+#if !defined(EMSCRIPTEN) && !defined(_MSC_VER) - /* enable stack limitation */ - #define CONFIG_STACK_CHECK - #endif -@@ -7302,7 +7301,7 @@ static int JS_DefinePrivateField(JSContext *ctx, JSValueConst obj, - JS_ThrowTypeErrorNotASymbol(ctx); - goto fail; - } -- prop = js_symbol_to_atom(ctx, (JSValue)name); -+ prop = js_symbol_to_atom(ctx, *(JSValue*)&name); - p = JS_VALUE_GET_OBJ(obj); - prs = find_own_property(&pr, p, prop); - if (prs) { -@@ -7333,7 +7332,7 @@ static JSValue JS_GetPrivateField(JSContext *ctx, JSValueConst obj, - /* safety check */ - if (unlikely(JS_VALUE_GET_TAG(name) != JS_TAG_SYMBOL)) - return JS_ThrowTypeErrorNotASymbol(ctx); -- prop = js_symbol_to_atom(ctx, (JSValue)name); -+ prop = js_symbol_to_atom(ctx, *(JSValue*)&name); - p = JS_VALUE_GET_OBJ(obj); - prs = find_own_property(&pr, p, prop); - if (!prs) { -@@ -7360,7 +7359,7 @@ static int JS_SetPrivateField(JSContext *ctx, JSValueConst obj, - JS_ThrowTypeErrorNotASymbol(ctx); - goto fail; - } -- prop = js_symbol_to_atom(ctx, (JSValue)name); -+ prop = js_symbol_to_atom(ctx, *(JSValue*)&name); - p = JS_VALUE_GET_OBJ(obj); - prs = find_own_property(&pr, p, prop); - if (!prs) { -@@ -7459,7 +7458,7 @@ static int JS_CheckBrand(JSContext *ctx, JSValueConst obj, JSValueConst func) - return -1; - } - p = JS_VALUE_GET_OBJ(obj); -- prs = find_own_property(&pr, p, js_symbol_to_atom(ctx, (JSValue)brand)); -+ prs = find_own_property(&pr, p, js_symbol_to_atom(ctx, *(JSValue*)&brand)); - return (prs != NULL); - } - -@@ -9079,7 +9078,7 @@ int JS_DefineProperty(JSContext *ctx, JSValueConst this_obj, - return -1; - } - /* this code relies on the fact that Uint32 are never allocated */ -- val = (JSValueConst)JS_NewUint32(ctx, array_length); -+ val = JS_NewUint32(ctx, array_length); - /* prs may have been modified */ - prs = find_own_property(&pr, p, prop); - assert(prs != NULL); -@@ -15980,7 +15979,7 @@ static JSValue js_call_c_function(JSContext *ctx, JSValueConst func_obj, - #else - sf->js_mode = 0; - #endif -- sf->cur_func = (JSValue)func_obj; -+ sf->cur_func = *(JSValue*)&func_obj; - sf->arg_count = argc; - arg_buf = argv; - -@@ -15993,7 +15992,7 @@ static JSValue js_call_c_function(JSContext *ctx, JSValueConst func_obj, - arg_buf[i] = JS_UNDEFINED; - sf->arg_count = arg_count; - } -- sf->arg_buf = (JSValue*)arg_buf; -+ sf->arg_buf = (JSValueConst*)arg_buf; - - func = p->u.cfunc.c_function; - switch(cproto) { -@@ -16225,7 +16224,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValueConst func_obj, - sf->js_mode = b->js_mode; - arg_buf = argv; - sf->arg_count = argc; -- sf->cur_func = (JSValue)func_obj; -+ sf->cur_func = *(JSValue*)&func_obj; - init_list_head(&sf->var_ref_list); - var_refs = p->u.func.var_refs; - -@@ -40392,8 +40391,8 @@ static int64_t JS_FlattenIntoArray(JSContext *ctx, JSValueConst target, - if (!JS_IsUndefined(mapperFunction)) { - JSValueConst args[3] = { element, JS_NewInt64(ctx, sourceIndex), source }; - element = JS_Call(ctx, mapperFunction, thisArg, 3, args); -- JS_FreeValue(ctx, (JSValue)args[0]); -- JS_FreeValue(ctx, (JSValue)args[1]); -+ JS_FreeValue(ctx, *(JSValue*)&args[0]); -+ JS_FreeValue(ctx, *(JSValue*)&args[1]); - if (JS_IsException(element)) - return -1; - } -@@ -41959,7 +41958,7 @@ static JSValue js_string_match(JSContext *ctx, JSValueConst this_val, - str = JS_NewString(ctx, "g"); - if (JS_IsException(str)) - goto fail; -- args[args_len++] = (JSValueConst)str; -+ args[args_len++] = *(JSValueConst*)&str; - } - rx = JS_CallConstructor(ctx, ctx->regexp_ctor, args_len, args); - JS_FreeValue(ctx, str); -@@ -43264,6 +43263,12 @@ static JSValue js_math_random(JSContext *ctx, JSValueConst this_val, - return __JS_NewFloat64(ctx, u.d - 1.0); - } - -+#ifdef _MSC_VER -+#pragma function (ceil) -+#pragma function (floor) -+#pragma function (log2) -+#endif -+ - static const JSCFunctionListEntry js_math_funcs[] = { - JS_CFUNC_MAGIC_DEF("min", 2, js_math_min_max, 0 ), - JS_CFUNC_MAGIC_DEF("max", 2, js_math_min_max, 1 ), -@@ -47158,7 +47163,7 @@ static JSMapRecord *map_add_record(JSContext *ctx, JSMapState *s, - } else { - JS_DupValue(ctx, key); - } -- mr->key = (JSValue)key; -+ mr->key = *(JSValue*)&key; - h = map_hash_key(ctx, key) & (s->hash_size - 1); - list_add_tail(&mr->hash_link, &s->hash_table[h]); - list_add_tail(&mr->link, &s->records); -@@ -47380,7 +47385,7 @@ static JSValue js_map_forEach(JSContext *ctx, JSValueConst this_val, - args[0] = args[1]; - else - args[0] = JS_DupValue(ctx, mr->value); -- args[2] = (JSValue)this_val; -+ args[2] = *(JSValue*)&this_val; - ret = JS_Call(ctx, func, this_arg, 3, (JSValueConst *)args); - JS_FreeValue(ctx, args[0]); - if (!magic) -@@ -48482,7 +48487,7 @@ static JSValue js_promise_all(JSContext *ctx, JSValueConst this_val, - goto fail_reject; - } - resolve_element_data[0] = JS_NewBool(ctx, FALSE); -- resolve_element_data[1] = (JSValueConst)JS_NewInt32(ctx, index); -+ resolve_element_data[1] = JS_NewInt32(ctx, index); - resolve_element_data[2] = values; - resolve_element_data[3] = resolving_funcs[is_promise_any]; - resolve_element_data[4] = resolve_element_env; -@@ -48841,7 +48846,7 @@ static JSValue js_async_from_sync_iterator_unwrap_func_create(JSContext *ctx, - { - JSValueConst func_data[1]; - -- func_data[0] = (JSValueConst)JS_NewBool(ctx, done); -+ func_data[0] = JS_NewBool(ctx, done); - return JS_NewCFunctionData(ctx, js_async_from_sync_iterator_unwrap, - 1, 0, 1, func_data); - } -@@ -54601,8 +54606,8 @@ static int js_TA_cmp_generic(const void *a, const void *b, void *opaque) { - psc->exception = 2; - } - done: -- JS_FreeValue(ctx, (JSValue)argv[0]); -- JS_FreeValue(ctx, (JSValue)argv[1]); -+ JS_FreeValue(ctx, *(JSValue*)&argv[0]); -+ JS_FreeValue(ctx, *(JSValue*)&argv[1]); - } - return cmp; - } -diff --git a/quickjs.h b/quickjs.h -index 7199936..30fdb2f 100644 ---- a/quickjs.h -+++ b/quickjs.h -@@ -670,7 +670,7 @@ static inline JSValue JS_DupValue(JSContext *ctx, JSValueConst v) - JSRefCountHeader *p = (JSRefCountHeader *)JS_VALUE_GET_PTR(v); - p->ref_count++; - } -- return (JSValue)v; -+ return *(JSValue*)&v; - } - - static inline JSValue JS_DupValueRT(JSRuntime *rt, JSValueConst v) -@@ -679,7 +679,7 @@ static inline JSValue JS_DupValueRT(JSRuntime *rt, JSValueConst v) - JSRefCountHeader *p = (JSRefCountHeader *)JS_VALUE_GET_PTR(v); - p->ref_count++; - } -- return (JSValue)v; -+ return *(JSValue*)&v; - } - - int JS_ToBool(JSContext *ctx, JSValueConst val); /* return -1 for JS_EXCEPTION */ diff --git a/sys/patches/check_stack_overflow.patch b/sys/patches/check_stack_overflow.patch deleted file mode 100644 index 40893834..00000000 --- a/sys/patches/check_stack_overflow.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/quickjs.c b/quickjs.c -index 48aeffc..45077cb 100644 ---- a/quickjs.c -+++ b/quickjs.c -@@ -1590,9 +1590,7 @@ static inline uintptr_t js_get_stack_pointer(void) - - static inline BOOL js_check_stack_overflow(JSRuntime *rt, size_t alloca_size) - { -- uintptr_t sp; -- sp = js_get_stack_pointer() - alloca_size; -- return unlikely(sp < rt->stack_limit); -+ return unlikely(js_get_stack_pointer() < rt->stack_limit + alloca_size); - } - #endif - diff --git a/sys/patches/error_column_number.patch b/sys/patches/error_column_number.patch deleted file mode 100644 index 2d89b306..00000000 --- a/sys/patches/error_column_number.patch +++ /dev/null @@ -1,1453 +0,0 @@ -diff --git a/Makefile b/Makefile -index 0270a6a..1c78547 100644 ---- a/Makefile -+++ b/Makefile -@@ -445,6 +445,7 @@ test: qjs - ./qjs tests/test_bignum.js - ./qjs tests/test_std.js - ./qjs tests/test_worker.js -+ ./qjs tests/test_line_column.js - ifdef CONFIG_SHARED_LIBS - ifdef CONFIG_BIGNUM - ./qjs --bignum tests/test_bjson.js -diff --git a/cutils.c b/cutils.c -index c0aacef..37ed9c2 100644 ---- a/cutils.c -+++ b/cutils.c -@@ -303,6 +303,16 @@ int unicode_from_utf8(const uint8_t *p, int max_len, const uint8_t **pp) - return c; - } - -+int utf8_str_len(const uint8_t *p_start, const uint8_t *p_end) { -+ int count = 0; -+ while (p_start < p_end) { -+ if (!unicode_from_utf8(p_start, UTF8_CHAR_LEN_MAX, &p_start)) -+ break; -+ count += 1; -+ } -+ return count; -+} -+ - #if 0 - - #if defined(EMSCRIPTEN) || defined(__ANDROID__) -diff --git a/cutils.h b/cutils.h -index f079e5c..75ab735 100644 ---- a/cutils.h -+++ b/cutils.h -@@ -297,6 +297,7 @@ static inline void dbuf_set_error(DynBuf *s) - - int unicode_to_utf8(uint8_t *buf, unsigned int c); - int unicode_from_utf8(const uint8_t *p, int max_len, const uint8_t **pp); -+int utf8_str_len(const uint8_t *p_start, const uint8_t *p_end); - - static inline BOOL is_surrogate(uint32_t c) - { -diff --git a/quickjs-atom.h b/quickjs-atom.h -index f4d5838..481ddb0 100644 ---- a/quickjs-atom.h -+++ b/quickjs-atom.h -@@ -81,6 +81,7 @@ DEF(empty_string, "") - DEF(length, "length") - DEF(fileName, "fileName") - DEF(lineNumber, "lineNumber") -+DEF(columnNumber, "columnNumber") - DEF(message, "message") - DEF(cause, "cause") - DEF(errors, "errors") -diff --git a/quickjs-opcode.h b/quickjs-opcode.h -index 1e18212..40cb15e 100644 ---- a/quickjs-opcode.h -+++ b/quickjs-opcode.h -@@ -291,6 +291,7 @@ def(get_array_el_opt_chain, 1, 2, 1, none) /* emitted in phase 1, removed in pha - def( set_class_name, 5, 1, 1, u32) /* emitted in phase 1, removed in phase 2 */ - - def( line_num, 5, 0, 0, u32) /* emitted in phase 1, removed in phase 3 */ -+def( column_num, 5, 0, 0, u32) /* emitted in phase 1, removed in phase 3 */ - - #if SHORT_OPCODES - DEF( push_minus1, 1, 0, 1, none_int) -diff --git a/quickjs.c b/quickjs.c -index e8fdd8a..92745d8 100644 ---- a/quickjs.c -+++ b/quickjs.c -@@ -573,6 +573,10 @@ typedef struct JSVarDef { - #define PC2LINE_RANGE 5 - #define PC2LINE_OP_FIRST 1 - #define PC2LINE_DIFF_PC_MAX ((255 - PC2LINE_OP_FIRST) / PC2LINE_RANGE) -+#define PC2COLUMN_BASE (-1) -+#define PC2COLUMN_RANGE 5 -+#define PC2COLUMN_OP_FIRST 1 -+#define PC2COLUMN_DIFF_PC_MAX ((255 - PC2COLUMN_OP_FIRST) / PC2COLUMN_RANGE) - - typedef enum JSFunctionKindEnum { - JS_FUNC_NORMAL = 0, -@@ -616,9 +620,12 @@ typedef struct JSFunctionBytecode { - /* debug info, move to separate structure to save memory? */ - JSAtom filename; - int line_num; -+ int column_num; - int source_len; - int pc2line_len; -+ int pc2column_len; - uint8_t *pc2line_buf; -+ uint8_t *pc2column_buf; - char *source; - } debug; - } JSFunctionBytecode; -@@ -5891,6 +5898,8 @@ typedef struct JSMemoryUsage_helper { - int64_t js_func_code_size; - int64_t js_func_pc2line_count; - int64_t js_func_pc2line_size; -+ int64_t js_func_pc2column_count; -+ int64_t js_func_pc2column_size; - } JSMemoryUsage_helper; - - static void compute_value_size(JSValueConst val, JSMemoryUsage_helper *hp); -@@ -5938,6 +5947,11 @@ static void compute_bytecode_size(JSFunctionBytecode *b, JSMemoryUsage_helper *h - hp->js_func_pc2line_count += 1; - hp->js_func_pc2line_size += b->debug.pc2line_len; - } -+ if (b->debug.pc2column_len) { -+ memory_used_count++; -+ hp->js_func_pc2column_count += 1; -+ hp->js_func_pc2column_size += b->debug.pc2column_len; -+ } - } - hp->js_func_size += js_func_size; - hp->js_func_count += 1; -@@ -6239,13 +6253,17 @@ void JS_ComputeMemoryUsage(JSRuntime *rt, JSMemoryUsage *s) - s->js_func_code_size = mem.js_func_code_size; - s->js_func_pc2line_count = mem.js_func_pc2line_count; - s->js_func_pc2line_size = mem.js_func_pc2line_size; -+ s->js_func_pc2column_count = mem.js_func_pc2column_count; -+ s->js_func_pc2column_size = mem.js_func_pc2column_size; - s->memory_used_count += round(mem.memory_used_count) + - s->atom_count + s->str_count + - s->obj_count + s->shape_count + -- s->js_func_count + s->js_func_pc2line_count; -+ s->js_func_count + s->js_func_pc2line_count + -+ s->js_func_pc2column_count; - s->memory_used_size += s->atom_size + s->str_size + - s->obj_size + s->prop_size + s->shape_size + -- s->js_func_size + s->js_func_code_size + s->js_func_pc2line_size; -+ s->js_func_size + s->js_func_code_size + s->js_func_pc2line_size + -+ s->js_func_pc2column_size; - } - - void JS_DumpMemoryUsage(FILE *fp, const JSMemoryUsage *s, JSRuntime *rt) -@@ -6357,6 +6375,12 @@ void JS_DumpMemoryUsage(FILE *fp, const JSMemoryUsage *s, JSRuntime *rt) - s->js_func_pc2line_size, - (double)s->js_func_pc2line_size / s->js_func_pc2line_count); - } -+ if(s->js_func_pc2column_count) { -+ fprintf(fp, "%-20s %8"PRId64" %8"PRId64" (%0.1f per function)\n", -+ " pc2column", s->js_func_pc2column_count, -+ s->js_func_pc2column_size, -+ (double)s->js_func_pc2column_size / s->js_func_pc2column_count); -+ } - } - if (s->c_func_count) { - fprintf(fp, "%-20s %8"PRId64"\n", "C functions", s->c_func_count); -@@ -6501,6 +6525,55 @@ static int find_line_num(JSContext *ctx, JSFunctionBytecode *b, - return line_num; - } - -+int find_column_num(JSContext* ctx, JSFunctionBytecode* b, -+ uint32_t pc_value) -+{ -+ const uint8_t* p_end, *p; -+ int new_column_num, column_num, pc, v, ret; -+ unsigned int op; -+ -+ if (!b->has_debug || !b->debug.pc2column_buf) { -+ /* function was stripped */ -+ return -1; -+ } -+ -+ pc = 0; -+ p = b->debug.pc2column_buf; -+ p_end = p + b->debug.pc2column_len; -+ column_num = b->debug.column_num; -+ while (p < p_end) { -+ op = *p++; -+ if (op == 0) { -+ uint32_t val; -+ ret = get_leb128(&val, p, p_end); -+ if (ret < 0) -+ goto fail; -+ pc += val; -+ p += ret; -+ ret = get_sleb128(&v, p, p_end); -+ if (ret < 0) { -+ fail: -+ /* should never happen */ -+ return b->debug.column_num; -+ } -+ p += ret; -+ new_column_num = column_num + v; -+ } else { -+ op -= PC2COLUMN_OP_FIRST; -+ pc += (op / PC2COLUMN_RANGE); -+ new_column_num = column_num + (op % PC2COLUMN_RANGE) + PC2COLUMN_BASE; -+ } -+ -+ if (pc_value < pc) { -+ return column_num; -+ } -+ -+ column_num = new_column_num; -+ } -+ -+ return column_num; -+} -+ - /* in order to avoid executing arbitrary code during the stack trace - generation, we only look at simple 'name' properties containing a - string. */ -@@ -6531,7 +6604,7 @@ static const char *get_func_name(JSContext *ctx, JSValueConst func) - and line number information (used for parse error). */ - static void build_backtrace(JSContext *ctx, JSValueConst error_obj, - const char *filename, int line_num, -- int backtrace_flags) -+ int column_num, int backtrace_flags) - { - JSStackFrame *sf; - JSValue str; -@@ -6540,18 +6613,24 @@ static void build_backtrace(JSContext *ctx, JSValueConst error_obj, - const char *str1; - JSObject *p; - BOOL backtrace_barrier; -+ int latest_line_num = -1; -+ int latest_column_num = -1; - - js_dbuf_init(ctx, &dbuf); - if (filename) { - dbuf_printf(&dbuf, " at %s", filename); -- if (line_num != -1) -+ if (line_num != -1) { -+ latest_line_num = line_num; - dbuf_printf(&dbuf, ":%d", line_num); -+ } -+ if (column_num != -1) { -+ latest_column_num = column_num; -+ dbuf_printf(&dbuf, ":%d", column_num); -+ } - dbuf_putc(&dbuf, '\n'); - str = JS_NewString(ctx, filename); - JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_fileName, str, - JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE); -- JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_lineNumber, JS_NewInt32(ctx, line_num), -- JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE); - if (backtrace_flags & JS_BACKTRACE_FLAG_SINGLE_LEVEL) - goto done; - } -@@ -6573,19 +6652,33 @@ static void build_backtrace(JSContext *ctx, JSValueConst error_obj, - if (js_class_has_bytecode(p->class_id)) { - JSFunctionBytecode *b; - const char *atom_str; -- int line_num1; - - b = p->u.func.function_bytecode; - backtrace_barrier = b->backtrace_barrier; - if (b->has_debug) { -- line_num1 = find_line_num(ctx, b, -- sf->cur_pc - b->byte_code_buf - 1); -+ line_num = find_line_num(ctx, b, sf->cur_pc - b->byte_code_buf - 1); -+ column_num = find_column_num(ctx, b, sf->cur_pc - b->byte_code_buf - 1); -+ line_num = line_num == -1 ? b->debug.line_num : line_num; -+ column_num = column_num == -1 ? b->debug.column_num : column_num; -+ if (column_num != -1) { -+ column_num += 1; -+ } -+ if (latest_line_num == -1) { -+ latest_line_num = line_num; -+ } -+ if (latest_column_num == -1) { -+ latest_column_num = column_num; -+ } - atom_str = JS_AtomToCString(ctx, b->debug.filename); - dbuf_printf(&dbuf, " (%s", - atom_str ? atom_str : ""); - JS_FreeCString(ctx, atom_str); -- if (line_num1 != -1) -- dbuf_printf(&dbuf, ":%d", line_num1); -+ if (line_num != -1) { -+ dbuf_printf(&dbuf, ":%d", line_num); -+ if (column_num != -1) { -+ dbuf_printf(&dbuf, ":%d", column_num); -+ } -+ } - dbuf_putc(&dbuf, ')'); - } - } else { -@@ -6605,6 +6698,15 @@ static void build_backtrace(JSContext *ctx, JSValueConst error_obj, - dbuf_free(&dbuf); - JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_stack, str, - JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE); -+ if (line_num != -1) { -+ JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_lineNumber, JS_NewInt32(ctx, latest_line_num), -+ JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE); -+ -+ if (column_num != -1) { -+ JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_columnNumber, JS_NewInt32(ctx, latest_column_num), -+ JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE); -+ } -+ } - } - - /* Note: it is important that no exception is returned by this function */ -@@ -6644,7 +6746,7 @@ static JSValue JS_ThrowError2(JSContext *ctx, JSErrorEnum error_num, - JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE); - } - if (add_backtrace) { -- build_backtrace(ctx, obj, NULL, 0, 0); -+ build_backtrace(ctx, obj, NULL, 0, 0, 0); - } - ret = JS_Throw(ctx, obj); - return ret; -@@ -14794,6 +14896,14 @@ static JSValue js_function_proto_lineNumber(JSContext *ctx, - return JS_UNDEFINED; - } - -+static JSValue js_function_proto_columnNumber(JSContext *ctx, JSValueConst this_val) { -+ JSFunctionBytecode* b = JS_GetFunctionBytecode(this_val); -+ if (b && b->has_debug) { -+ return JS_NewInt32(ctx, b->debug.column_num); -+ } -+ return JS_UNDEFINED; -+} -+ - static int js_arguments_define_own_property(JSContext *ctx, - JSValueConst this_obj, - JSAtom prop, JSValueConst val, -@@ -18637,7 +18747,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValueConst func_obj, - before if the exception happens in a bytecode - operation */ - sf->cur_pc = pc; -- build_backtrace(ctx, rt->current_exception, NULL, 0, 0); -+ build_backtrace(ctx, rt->current_exception, NULL, 0, 0, 0); - } - if (!JS_IsUncatchableError(ctx, rt->current_exception)) { - while (sp > stack_buf) { -@@ -19911,6 +20021,11 @@ typedef struct LineNumberSlot { - int line_num; - } LineNumberSlot; - -+typedef struct ColumnNumberSlot { -+ uint32_t pc; -+ int column_num; -+} ColumnNumberSlot; -+ - typedef enum JSParseFunctionEnum { - JS_PARSE_FUNC_STATEMENT, - JS_PARSE_FUNC_VAR, -@@ -20030,10 +20145,18 @@ typedef struct JSFunctionDef { - int line_number_last; - int line_number_last_pc; - -+ ColumnNumberSlot* column_number_slots; -+ int column_number_size; -+ int column_number_count; -+ int column_number_last_pc; -+ int column_number_last; -+ - /* pc2line table */ - JSAtom filename; - int line_num; -+ int column_num; - DynBuf pc2line; -+ DynBuf pc2column; - - char *source; /* raw source, utf-8 encoded */ - int source_len; -@@ -20044,7 +20167,8 @@ typedef struct JSFunctionDef { - - typedef struct JSToken { - int val; -- int line_num; /* line number of token start */ -+ int line_num; /* line number of token start */ -+ int column_num; /* colum number of token start */ - const uint8_t *ptr; - union { - struct { -@@ -20073,6 +20197,9 @@ typedef struct JSParseState { - JSContext *ctx; - int last_line_num; /* line number of last token */ - int line_num; /* line number of current offset */ -+ const uint8_t *column_ptr; -+ const uint8_t *column_last_ptr; -+ int column_num_count; - const char *filename; - JSToken token; - BOOL got_lf; /* true if got line feed before the current token */ -@@ -20213,11 +20340,19 @@ static void __attribute((unused)) dump_token(JSParseState *s, - } - } - -+static int calc_column_position(JSParseState *s) { -+ if(s->column_last_ptr > s->column_ptr) { -+ s->column_num_count += utf8_str_len(s->column_ptr, s->column_last_ptr); -+ s->column_ptr = s->column_last_ptr; -+ } -+ return s->column_num_count; -+} -+ - int __attribute__((format(printf, 2, 3))) js_parse_error(JSParseState *s, const char *fmt, ...) - { - JSContext *ctx = s->ctx; - va_list ap; -- int backtrace_flags; -+ int backtrace_flags, column_num; - - va_start(ap, fmt); - JS_ThrowError2(ctx, JS_SYNTAX_ERROR, fmt, ap, FALSE); -@@ -20225,7 +20360,9 @@ int __attribute__((format(printf, 2, 3))) js_parse_error(JSParseState *s, const - backtrace_flags = 0; - if (s->cur_func && s->cur_func->backtrace_barrier) - backtrace_flags = JS_BACKTRACE_FLAG_SINGLE_LEVEL; -+ column_num = calc_column_position(s); - build_backtrace(ctx, ctx->rt->current_exception, s->filename, s->line_num, -+ column_num < 0 ? -1 : column_num, - backtrace_flags); - return -1; - } -@@ -20263,6 +20400,7 @@ static __exception int js_parse_template_part(JSParseState *s, const uint8_t *p) - { - uint32_t c; - StringBuffer b_s, *b = &b_s; -+ s->token.column_num = calc_column_position(s); - - /* p points to the first byte of the template part */ - if (string_buffer_init(s->ctx, b, 32)) -@@ -20295,6 +20433,8 @@ static __exception int js_parse_template_part(JSParseState *s, const uint8_t *p) - } - if (c == '\n') { - s->line_num++; -+ s->column_ptr = s->column_last_ptr = p; -+ s->column_num_count = 0; - } else if (c >= 0x80) { - const uint8_t *p_next; - c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next); -@@ -20327,6 +20467,7 @@ static __exception int js_parse_string(JSParseState *s, int sep, - int ret; - uint32_t c; - StringBuffer b_s, *b = &b_s; -+ s->token.column_num = calc_column_position(s); - - /* string */ - if (string_buffer_init(s->ctx, b, 32)) -@@ -20382,8 +20523,11 @@ static __exception int js_parse_string(JSParseState *s, int sep, - case '\n': - /* ignore escaped newline sequence */ - p++; -- if (sep != '`') -+ if (sep != '`') { - s->line_num++; -+ s->column_ptr = s->column_last_ptr = p; -+ s->column_num_count = 0; -+ } - continue; - default: - if (c >= '0' && c <= '9') { -@@ -20698,7 +20842,9 @@ static __exception int next_token(JSParseState *s) - s->got_lf = FALSE; - s->last_line_num = s->token.line_num; - redo: -+ s->column_last_ptr = p; - s->token.line_num = s->line_num; -+ s->token.column_num = 0; - s->token.ptr = p; - c = *p; - switch(c) { -@@ -20729,6 +20875,8 @@ static __exception int next_token(JSParseState *s) - line_terminator: - s->got_lf = TRUE; - s->line_num++; -+ s->column_ptr = p; -+ s->column_num_count = 0; - goto redo; - case '\f': - case '\v': -@@ -20752,7 +20900,8 @@ static __exception int next_token(JSParseState *s) - if (*p == '\n') { - s->line_num++; - s->got_lf = TRUE; /* considered as LF for ASI */ -- p++; -+ s->column_ptr = ++p; -+ s->column_num_count = 0; - } else if (*p == '\r') { - s->got_lf = TRUE; /* considered as LF for ASI */ - p++; -@@ -21164,6 +21313,9 @@ static __exception int next_token(JSParseState *s) - break; - } - s->buf_ptr = p; -+ if (!s->token.column_num) { -+ s->token.column_num = calc_column_position(s); -+ } - - // dump_token(s, &s->token); - return 0; -@@ -21222,7 +21374,9 @@ static __exception int json_next_token(JSParseState *s) - p = s->last_ptr = s->buf_ptr; - s->last_line_num = s->token.line_num; - redo: -+ s->column_last_ptr = p; - s->token.line_num = s->line_num; -+ s->token.column_num = 0; - s->token.ptr = p; - c = *p; - switch(c) { -@@ -21251,6 +21405,8 @@ static __exception int json_next_token(JSParseState *s) - case '\n': - p++; - s->line_num++; -+ s->column_ptr = p; -+ s->column_num_count = 0; - goto redo; - case '\f': - case '\v': -@@ -21282,7 +21438,8 @@ static __exception int json_next_token(JSParseState *s) - } - if (*p == '\n') { - s->line_num++; -- p++; -+ s->column_ptr = ++p; -+ s->column_num_count = 0; - } else if (*p == '\r') { - p++; - } else if (*p >= 0x80) { -@@ -21392,6 +21549,9 @@ static __exception int json_next_token(JSParseState *s) - break; - } - s->buf_ptr = p; -+ if (!s->token.column_num) { -+ s->token.column_num = calc_column_position(s); -+ } - - // dump_token(s, &s->token); - return 0; -@@ -21599,6 +21759,11 @@ static void emit_atom(JSParseState *s, JSAtom name) - emit_u32(s, JS_DupAtom(s->ctx, name)); - } - -+static void emit_column(JSParseState *s, int column_num) { -+ emit_u8(s, OP_column_num); -+ emit_u32(s, column_num); -+} -+ - static int update_label(JSFunctionDef *s, int label, int delta) - { - LabelSlot *ls; -@@ -22162,7 +22327,7 @@ static __exception int js_parse_function_decl(JSParseState *s, - JSParseFunctionEnum func_type, - JSFunctionKindEnum func_kind, - JSAtom func_name, const uint8_t *ptr, -- int start_line); -+ int start_line, int start_column); - static JSFunctionDef *js_parse_function_class_fields_init(JSParseState *s); - static __exception int js_parse_function_decl2(JSParseState *s, - JSParseFunctionEnum func_type, -@@ -22170,6 +22335,7 @@ static __exception int js_parse_function_decl2(JSParseState *s, - JSAtom func_name, - const uint8_t *ptr, - int function_line_num, -+ int function_column_num, - JSParseExportEnum export_flag, - JSFunctionDef **pfd); - static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags); -@@ -22463,12 +22629,18 @@ typedef struct JSParsePos { - int line_num; - BOOL got_lf; - const uint8_t *ptr; -+ const uint8_t *column_ptr; -+ const uint8_t *column_last_ptr; -+ int column_num_count; - } JSParsePos; - - static int js_parse_get_pos(JSParseState *s, JSParsePos *sp) - { - sp->last_line_num = s->last_line_num; - sp->line_num = s->token.line_num; -+ sp->column_ptr = s->column_ptr; -+ sp->column_last_ptr = s->column_last_ptr; -+ sp->column_num_count = s->column_num_count; - sp->ptr = s->token.ptr; - sp->got_lf = s->got_lf; - return 0; -@@ -22478,6 +22650,9 @@ static __exception int js_parse_seek_token(JSParseState *s, const JSParsePos *sp - { - s->token.line_num = sp->last_line_num; - s->line_num = sp->line_num; -+ s->column_ptr = sp->column_ptr; -+ s->column_last_ptr = sp->column_last_ptr; -+ s->column_num_count = sp->column_num_count; - s->buf_ptr = sp->ptr; - s->got_lf = sp->got_lf; - return next_token(s); -@@ -22683,7 +22858,7 @@ static __exception int js_parse_object_literal(JSParseState *s) - { - JSAtom name = JS_ATOM_NULL; - const uint8_t *start_ptr; -- int start_line, prop_type; -+ int start_line, start_column, prop_type; - BOOL has_proto; - - if (next_token(s)) -@@ -22695,6 +22870,7 @@ static __exception int js_parse_object_literal(JSParseState *s) - /* specific case for getter/setter */ - start_ptr = s->token.ptr; - start_line = s->token.line_num; -+ start_column = s->token.column_num; - - if (s->token.val == TOK_ELLIPSIS) { - if (next_token(s)) -@@ -22740,7 +22916,7 @@ static __exception int js_parse_object_literal(JSParseState *s) - func_kind = JS_FUNC_ASYNC_GENERATOR; - } - if (js_parse_function_decl(s, func_type, func_kind, JS_ATOM_NULL, -- start_ptr, start_line)) -+ start_ptr, start_line, start_column)) - goto fail; - if (name == JS_ATOM_NULL) { - emit_op(s, OP_define_method_computed); -@@ -22816,7 +22992,7 @@ static __exception int js_parse_class_default_ctor(JSParseState *s, - { - JSParsePos pos; - const char *str; -- int ret, line_num; -+ int ret, line_num, column_num; - JSParseFunctionEnum func_type; - const uint8_t *saved_buf_end; - -@@ -22830,14 +23006,17 @@ static __exception int js_parse_class_default_ctor(JSParseState *s, - func_type = JS_PARSE_FUNC_CLASS_CONSTRUCTOR; - } - line_num = s->token.line_num; -+ column_num = s->token.column_num; - saved_buf_end = s->buf_end; - s->buf_ptr = (uint8_t *)str; - s->buf_end = (uint8_t *)(str + strlen(str)); -+ s->column_last_ptr = s->buf_ptr; - ret = next_token(s); - if (!ret) { - ret = js_parse_function_decl2(s, func_type, JS_FUNC_NORMAL, - JS_ATOM_NULL, (uint8_t *)str, -- line_num, JS_PARSE_EXPORT_NONE, pfd); -+ line_num, column_num, -+ JS_PARSE_EXPORT_NONE, pfd); - } - s->buf_end = saved_buf_end; - ret |= js_parse_seek_token(s, &pos); -@@ -23070,7 +23249,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr, - // stack is now: - if (js_parse_function_decl2(s, JS_PARSE_FUNC_CLASS_STATIC_INIT, - JS_FUNC_NORMAL, JS_ATOM_NULL, -- s->token.ptr, s->token.line_num, -+ s->token.ptr, s->token.line_num,s->token.column_num, - JS_PARSE_EXPORT_NONE, &init) < 0) { - goto fail; - } -@@ -23146,7 +23325,8 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr, - if (js_parse_function_decl2(s, JS_PARSE_FUNC_GETTER + is_set, - JS_FUNC_NORMAL, JS_ATOM_NULL, - start_ptr, s->token.line_num, -- JS_PARSE_EXPORT_NONE, &method_fd)) -+ s->token.column_num, JS_PARSE_EXPORT_NONE, -+ &method_fd)) - goto fail; - if (is_private) { - method_fd->need_home_object = TRUE; /* needed for brand check */ -@@ -23289,7 +23469,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr, - if (is_private) { - class_fields[is_static].need_brand = TRUE; - } -- if (js_parse_function_decl2(s, func_type, func_kind, JS_ATOM_NULL, start_ptr, s->token.line_num, JS_PARSE_EXPORT_NONE, &method_fd)) -+ if (js_parse_function_decl2(s, func_type, func_kind, JS_ATOM_NULL, start_ptr, s->token.line_num, s->token.column_num, JS_PARSE_EXPORT_NONE, &method_fd)) - goto fail; - if (func_type == JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR || - func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR) { -@@ -23979,6 +24159,7 @@ static int js_parse_destructuring_element(JSParseState *s, int tok, int is_arg, - JSAtom prop_name, var_name; - int opcode, scope, tok1, skip_bits; - BOOL has_initializer; -+ emit_column(s, s->token.column_num); - - if (has_ellipsis < 0) { - /* pre-parse destructuration target for spread detection */ -@@ -24416,10 +24597,12 @@ static void optional_chain_test(JSParseState *s, int *poptional_chaining_label, - static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags) - { - FuncCallType call_type; -- int optional_chaining_label; -+ int optional_chaining_label, column_num; - BOOL accept_lparen = (parse_flags & PF_POSTFIX_CALL) != 0; - - call_type = FUNC_CALL_NORMAL; -+ column_num = s->token.column_num; -+ emit_column(s, column_num); - switch(s->token.val) { - case TOK_NUMBER: - { -@@ -24499,7 +24682,7 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags) - backtrace_flags = JS_BACKTRACE_FLAG_SINGLE_LEVEL; - build_backtrace(s->ctx, s->ctx->rt->current_exception, - s->filename, s->token.line_num, -- backtrace_flags); -+ s->token.column_num, backtrace_flags); - return -1; - } - ret = emit_push_const(s, str, 0); -@@ -24521,7 +24704,8 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags) - case TOK_FUNCTION: - if (js_parse_function_decl(s, JS_PARSE_FUNC_EXPR, - JS_FUNC_NORMAL, JS_ATOM_NULL, -- s->token.ptr, s->token.line_num)) -+ s->token.ptr, s->token.line_num, -+ s->token.column_num)) - return -1; - break; - case TOK_CLASS: -@@ -24560,15 +24744,18 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags) - peek_token(s, TRUE) != '\n') { - const uint8_t *source_ptr; - int source_line_num; -+ int source_column_num; - - source_ptr = s->token.ptr; - source_line_num = s->token.line_num; -+ source_column_num = s->token.column_num; - if (next_token(s)) - return -1; - if (s->token.val == TOK_FUNCTION) { - if (js_parse_function_decl(s, JS_PARSE_FUNC_EXPR, - JS_FUNC_ASYNC, JS_ATOM_NULL, -- source_ptr, source_line_num)) -+ source_ptr, source_line_num, -+ source_column_num)) - return -1; - } else { - name = JS_DupAtom(s->ctx, JS_ATOM_async); -@@ -24960,6 +25147,7 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags) - break; - } - } else { -+ emit_column(s, column_num); - if (next_token(s)) - return -1; - emit_func_call: -@@ -25003,6 +25191,8 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags) - } else if (s->token.val == '.') { - if (next_token(s)) - return -1; -+ column_num = s->token.column_num; -+ emit_column(s, column_num); - parse_property: - if (s->token.val == TOK_PRIVATE_NAME) { - /* private class field */ -@@ -25086,6 +25276,7 @@ static __exception int js_parse_delete(JSParseState *s) - JSFunctionDef *fd = s->cur_func; - JSAtom name; - int opcode; -+ emit_column(s, s->token.column_num); - - if (next_token(s)) - return -1; -@@ -25549,6 +25740,7 @@ static __exception int js_parse_coalesce_expr(JSParseState *s, int parse_flags) - emit_op(s, OP_is_undefined_or_null); - emit_goto(s, OP_if_false, label1); - emit_op(s, OP_drop); -+ emit_column(s, s->token.column_num); - - if (js_parse_expr_binary(s, 8, parse_flags)) - return -1; -@@ -25597,6 +25789,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags) - int opcode, op, scope; - JSAtom name0 = JS_ATOM_NULL; - JSAtom name; -+ emit_column(s, s->token.column_num); - - if (s->token.val == TOK_YIELD) { - BOOL is_star = FALSE, is_async; -@@ -25739,10 +25932,10 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags) - js_parse_skip_parens_token(s, NULL, TRUE) == TOK_ARROW) { - return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW, - JS_FUNC_NORMAL, JS_ATOM_NULL, -- s->token.ptr, s->token.line_num); -+ s->token.ptr, s->token.line_num, s->token.column_num); - } else if (token_is_pseudo_keyword(s, JS_ATOM_async)) { - const uint8_t *source_ptr; -- int source_line_num, tok; -+ int source_line_num, source_column_num, tok; - JSParsePos pos; - - /* fast test */ -@@ -25752,6 +25945,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags) - - source_ptr = s->token.ptr; - source_line_num = s->token.line_num; -+ source_column_num = s->token.column_num; - js_parse_get_pos(s, &pos); - if (next_token(s)) - return -1; -@@ -25761,7 +25955,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags) - peek_token(s, TRUE) == TOK_ARROW)) { - return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW, - JS_FUNC_ASYNC, JS_ATOM_NULL, -- source_ptr, source_line_num); -+ source_ptr, source_line_num, source_column_num); - } else { - /* undo the token parsing */ - if (js_parse_seek_token(s, &pos)) -@@ -25771,7 +25965,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags) - peek_token(s, TRUE) == TOK_ARROW) { - return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW, - JS_FUNC_NORMAL, JS_ATOM_NULL, -- s->token.ptr, s->token.line_num); -+ s->token.ptr, s->token.line_num, s->token.column_num); - } - next: - if (s->token.val == TOK_IDENT) { -@@ -26496,6 +26690,7 @@ static __exception int js_parse_statement_or_decl(JSParseState *s, - JSContext *ctx = s->ctx; - JSAtom label_name; - int tok; -+ emit_column(s, s->token.column_num); - - /* specific label handling */ - /* XXX: support multiple labels on loop statements */ -@@ -27185,7 +27380,8 @@ static __exception int js_parse_statement_or_decl(JSParseState *s, - parse_func_var: - if (js_parse_function_decl(s, JS_PARSE_FUNC_VAR, - JS_FUNC_NORMAL, JS_ATOM_NULL, -- s->token.ptr, s->token.line_num)) -+ s->token.ptr, s->token.line_num, -+ s->token.column_num)) - goto fail; - break; - } -@@ -29096,7 +29292,8 @@ static __exception int js_parse_export(JSParseState *s) - return js_parse_function_decl2(s, JS_PARSE_FUNC_STATEMENT, - JS_FUNC_NORMAL, JS_ATOM_NULL, - s->token.ptr, s->token.line_num, -- JS_PARSE_EXPORT_NAMED, NULL); -+ s->token.column_num, JS_PARSE_EXPORT_NAMED, -+ NULL); - } - - if (next_token(s)) -@@ -29206,7 +29403,8 @@ static __exception int js_parse_export(JSParseState *s) - return js_parse_function_decl2(s, JS_PARSE_FUNC_STATEMENT, - JS_FUNC_NORMAL, JS_ATOM_NULL, - s->token.ptr, s->token.line_num, -- JS_PARSE_EXPORT_DEFAULT, NULL); -+ s->token.column_num, JS_PARSE_EXPORT_DEFAULT, -+ NULL); - } else { - if (js_parse_assign_expr(s)) - return -1; -@@ -29403,7 +29601,8 @@ static __exception int js_parse_source_element(JSParseState *s) - peek_token(s, TRUE) == TOK_FUNCTION)) { - if (js_parse_function_decl(s, JS_PARSE_FUNC_STATEMENT, - JS_FUNC_NORMAL, JS_ATOM_NULL, -- s->token.ptr, s->token.line_num)) -+ s->token.ptr, s->token.line_num, -+ s->token.column_num)) - return -1; - } else if (s->token.val == TOK_EXPORT && fd->module) { - if (js_parse_export(s)) -@@ -29425,7 +29624,9 @@ static JSFunctionDef *js_new_function_def(JSContext *ctx, - JSFunctionDef *parent, - BOOL is_eval, - BOOL is_func_expr, -- const char *filename, int line_num) -+ const char *filename, -+ int line_num, -+ int column_num) - { - JSFunctionDef *fd; - -@@ -29473,8 +29674,10 @@ static JSFunctionDef *js_new_function_def(JSContext *ctx, - - fd->filename = JS_NewAtom(ctx, filename); - fd->line_num = line_num; -+ fd->column_num = column_num; - - js_dbuf_init(ctx, &fd->pc2line); -+ js_dbuf_init(ctx, &fd->pc2column); - //fd->pc2line_last_line_num = line_num; - //fd->pc2line_last_pc = 0; - fd->last_opcode_line_num = line_num; -@@ -29533,6 +29736,7 @@ static void js_free_function_def(JSContext *ctx, JSFunctionDef *fd) - js_free(ctx, fd->jump_slots); - js_free(ctx, fd->label_slots); - js_free(ctx, fd->line_number_slots); -+ js_free(ctx, fd->column_number_slots); - - for(i = 0; i < fd->cpool_count; i++) { - JS_FreeValue(ctx, fd->cpool[i]); -@@ -29566,6 +29770,7 @@ static void js_free_function_def(JSContext *ctx, JSFunctionDef *fd) - - JS_FreeAtom(ctx, fd->filename); - dbuf_free(&fd->pc2line); -+ dbuf_free(&fd->pc2column); - - js_free(ctx, fd->source); - -@@ -31563,6 +31768,10 @@ static __exception int resolve_variables(JSContext *ctx, JSFunctionDef *s) - s->line_number_size++; - goto no_change; - -+ case OP_column_num: -+ s->column_number_size++; -+ goto no_change; -+ - case OP_eval: /* convert scope index to adjusted variable index */ - { - int call_argc = get_u16(bc_buf + pos + 1); -@@ -31877,6 +32086,21 @@ static void add_pc2line_info(JSFunctionDef *s, uint32_t pc, int line_num) - } - } - -+/* the pc2col table gives a column number for each PC value */ -+static void add_pc2col_info(JSFunctionDef *s, uint32_t pc, int column_num) -+{ -+ if(s->column_number_slots != NULL -+ && s->column_number_count < s->column_number_size -+ && pc >= s->column_number_last_pc -+ && column_num != s->column_number_last) { -+ s->column_number_slots[s->column_number_count].pc = pc; -+ s->column_number_slots[s->column_number_count].column_num = column_num; -+ s->column_number_count++; -+ s->column_number_last_pc = pc; -+ s->column_number_last = column_num; -+ } -+} -+ - static void compute_pc2line_info(JSFunctionDef *s) - { - if (!(s->js_mode & JS_MODE_STRIP) && s->line_number_slots) { -@@ -31915,6 +32139,45 @@ static void compute_pc2line_info(JSFunctionDef *s) - } - } - -+static void compute_pc2column_info(JSFunctionDef *s) -+{ -+ if(!(s->js_mode & JS_MODE_STRIP) && s->column_number_slots) { -+ int last_column_num = s->column_num; -+ uint32_t last_pc = 0; -+ int i; -+ -+ js_dbuf_init(s->ctx, &s->pc2column); -+ for(i = 0; i < s->column_number_count; i++) { -+ uint32_t pc = s->column_number_slots[i].pc; -+ int column_num = s->column_number_slots[i].column_num; -+ int diff_pc, diff_column; -+ -+ if (column_num < 0) -+ continue; -+ -+ diff_pc = pc - last_pc; -+ diff_column = column_num - last_column_num; -+ if (diff_column == 0 || diff_pc < 0) -+ continue; -+ -+ if (diff_column >= PC2COLUMN_BASE && -+ diff_column < PC2COLUMN_BASE + PC2COLUMN_RANGE && -+ diff_pc <= PC2COLUMN_DIFF_PC_MAX) { -+ dbuf_putc(&s->pc2column, (diff_column - PC2COLUMN_BASE) + -+ diff_pc * PC2COLUMN_RANGE + PC2COLUMN_OP_FIRST); -+ } else { -+ /* longer encoding */ -+ dbuf_putc(&s->pc2column, 0); -+ dbuf_put_leb128(&s->pc2column, diff_pc); -+ dbuf_put_sleb128(&s->pc2column, diff_column); -+ } -+ -+ last_pc = pc; -+ last_column_num = column_num; -+ } -+ } -+} -+ - static RelocEntry *add_reloc(JSContext *ctx, LabelSlot *ls, uint32_t addr, int size) - { - RelocEntry *re; -@@ -32079,7 +32342,7 @@ static void put_short_code(DynBuf *bc_out, int op, int idx) - /* peephole optimizations and resolve goto/labels */ - static __exception int resolve_labels(JSContext *ctx, JSFunctionDef *s) - { -- int pos, pos_next, bc_len, op, op1, len, i, line_num; -+ int pos, pos_next, bc_len, op, op1, len, i, line_num, column_num; - const uint8_t *bc_buf; - DynBuf bc_out; - LabelSlot *label_slots, *ls; -@@ -32093,7 +32356,7 @@ static __exception int resolve_labels(JSContext *ctx, JSFunctionDef *s) - label_slots = s->label_slots; - - line_num = s->line_num; -- -+ column_num = s->column_num; - cc.bc_buf = bc_buf = s->byte_code.buf; - cc.bc_len = bc_len = s->byte_code.size; - js_dbuf_init(ctx, &bc_out); -@@ -32114,6 +32377,14 @@ static __exception int resolve_labels(JSContext *ctx, JSFunctionDef *s) - s->line_number_last_pc = 0; - } - -+ if(s->column_number_size && !(s->js_mode & JS_MODE_STRIP)) { -+ s->column_number_slots = js_mallocz(s->ctx, sizeof(*s->column_number_slots) * s->column_number_size); -+ if(s->column_number_slots == NULL) -+ return -1; -+ s->column_number_last = s->column_num; -+ s->column_number_last_pc = 0; -+ } -+ - /* initialize the 'home_object' variable if needed */ - if (s->home_object_var_idx >= 0) { - dbuf_putc(&bc_out, OP_special_object); -@@ -32187,6 +32458,12 @@ static __exception int resolve_labels(JSContext *ctx, JSFunctionDef *s) - line_num = get_u32(bc_buf + pos + 1); - break; - -+ case OP_column_num: -+ /* same with OP_line_num */ -+ column_num = get_u32(bc_buf + pos + 1); -+ add_pc2col_info(s, bc_out.size, column_num); -+ break; -+ - case OP_label: - { - label = get_u32(bc_buf + pos + 1); -@@ -32910,6 +33187,11 @@ static __exception int resolve_labels(JSContext *ctx, JSFunctionDef *s) - if (s->line_number_slots[j].pc > pos) - s->line_number_slots[j].pc -= delta; - } -+ for (j = 0; j < s->column_number_count; j++) { -+ if (s->column_number_slots[j].pc > pos) { -+ s->column_number_slots[j].pc -= delta; -+ } -+ } - continue; - } - break; -@@ -32941,8 +33223,11 @@ static __exception int resolve_labels(JSContext *ctx, JSFunctionDef *s) - s->label_slots = NULL; - /* XXX: should delay until copying to runtime bytecode function */ - compute_pc2line_info(s); -+ compute_pc2column_info(s); - js_free(ctx, s->line_number_slots); -+ js_free(ctx, s->column_number_slots); - s->line_number_slots = NULL; -+ s->column_number_slots = NULL; - /* set the new byte code */ - dbuf_free(&s->byte_code); - s->byte_code = bc_out; -@@ -33413,6 +33698,7 @@ static JSValue js_create_function(JSContext *ctx, JSFunctionDef *fd) - if (fd->js_mode & JS_MODE_STRIP) { - JS_FreeAtom(ctx, fd->filename); - dbuf_free(&fd->pc2line); // probably useless -+ dbuf_free(&fd->pc2column); - } else { - /* XXX: source and pc2line info should be packed at the end of the - JSFunctionBytecode structure, avoiding allocation overhead -@@ -33420,14 +33706,19 @@ static JSValue js_create_function(JSContext *ctx, JSFunctionDef *fd) - b->has_debug = 1; - b->debug.filename = fd->filename; - b->debug.line_num = fd->line_num; -+ b->debug.column_num = fd->column_num; - - //DynBuf pc2line; - //compute_pc2line_info(fd, &pc2line); - //js_free(ctx, fd->line_number_slots) - b->debug.pc2line_buf = js_realloc(ctx, fd->pc2line.buf, fd->pc2line.size); -+ b->debug.pc2column_buf = js_realloc(ctx, fd->pc2column.buf, fd->pc2column.size); - if (!b->debug.pc2line_buf) - b->debug.pc2line_buf = fd->pc2line.buf; -+ if(!b->debug.pc2column_buf) -+ b->debug.pc2column_buf = fd->pc2column.buf; - b->debug.pc2line_len = fd->pc2line.size; -+ b->debug.pc2column_len = fd->pc2column.size; - b->debug.source = fd->source; - b->debug.source_len = fd->source_len; - } -@@ -33510,6 +33801,7 @@ static void free_function_bytecode(JSRuntime *rt, JSFunctionBytecode *b) - if (b->has_debug) { - JS_FreeAtomRT(rt, b->debug.filename); - js_free_rt(rt, b->debug.pc2line_buf); -+ js_free_rt(rt, b->debug.pc2column_buf); - js_free_rt(rt, b->debug.source); - } - -@@ -33673,7 +33965,7 @@ static JSFunctionDef *js_parse_function_class_fields_init(JSParseState *s) - JSFunctionDef *fd; - - fd = js_new_function_def(s->ctx, s->cur_func, FALSE, FALSE, -- s->filename, 0); -+ s->filename, 0, 0); - if (!fd) - return NULL; - fd->func_name = JS_ATOM_NULL; -@@ -33701,6 +33993,7 @@ static __exception int js_parse_function_decl2(JSParseState *s, - JSAtom func_name, - const uint8_t *ptr, - int function_line_num, -+ int function_column_num, - JSParseExportEnum export_flag, - JSFunctionDef **pfd) - { -@@ -33815,7 +34108,8 @@ static __exception int js_parse_function_decl2(JSParseState *s, - } - - fd = js_new_function_def(ctx, fd, FALSE, is_expr, -- s->filename, function_line_num); -+ s->filename, function_line_num, -+ function_column_num); - if (!fd) { - JS_FreeAtom(ctx, func_name); - return -1; -@@ -34265,11 +34559,12 @@ static __exception int js_parse_function_decl(JSParseState *s, - JSFunctionKindEnum func_kind, - JSAtom func_name, - const uint8_t *ptr, -- int function_line_num) -+ int function_line_num, -+ int function_column_num) - { - return js_parse_function_decl2(s, func_type, func_kind, func_name, ptr, -- function_line_num, JS_PARSE_EXPORT_NONE, -- NULL); -+ function_line_num, function_column_num, -+ JS_PARSE_EXPORT_NONE, NULL); - } - - static __exception int js_parse_program(JSParseState *s) -@@ -34332,10 +34627,14 @@ static void js_parse_init(JSContext *ctx, JSParseState *s, - s->ctx = ctx; - s->filename = filename; - s->line_num = 1; -+ s->column_ptr = (const uint8_t*)input; -+ s->column_last_ptr = s->column_ptr; -+ s->column_num_count = 0; - s->buf_ptr = (const uint8_t *)input; - s->buf_end = s->buf_ptr + input_len; - s->token.val = ' '; - s->token.line_num = 1; -+ s->token.column_num = 0; - } - - static JSValue JS_EvalFunctionInternal(JSContext *ctx, JSValue fun_obj, -@@ -34423,7 +34722,7 @@ static JSValue __JS_EvalInternal(JSContext *ctx, JSValueConst this_obj, - js_mode |= JS_MODE_STRICT; - } - } -- fd = js_new_function_def(ctx, NULL, TRUE, FALSE, filename, 1); -+ fd = js_new_function_def(ctx, NULL, TRUE, FALSE, filename, 1, 0); - if (!fd) - goto fail1; - s->cur_func = fd; -@@ -35174,6 +35473,9 @@ static int JS_WriteFunctionTag(BCWriterState *s, JSValueConst obj) - bc_put_leb128(s, b->debug.line_num); - bc_put_leb128(s, b->debug.pc2line_len); - dbuf_put(&s->dbuf, b->debug.pc2line_buf, b->debug.pc2line_len); -+ bc_put_leb128(s, b->debug.column_num); -+ bc_put_leb128(s, b->debug.pc2column_len); -+ dbuf_put(&s->dbuf, b->debug.pc2column_buf, b->debug.pc2column_len); - } - - for(i = 0; i < b->cpool_count; i++) { -@@ -36216,6 +36518,17 @@ static JSValue JS_ReadFunctionTag(BCReaderState *s) - if (bc_get_buf(s, b->debug.pc2line_buf, b->debug.pc2line_len)) - goto fail; - } -+ if (bc_get_leb128_int(s, &b->debug.column_num)) -+ goto fail; -+ if (bc_get_leb128_int(s, &b->debug.pc2column_len)) -+ goto fail; -+ if (b->debug.pc2column_len) { -+ b->debug.pc2column_buf = js_mallocz(ctx, b->debug.pc2column_len); -+ if (!b->debug.pc2column_buf) -+ goto fail; -+ if (bc_get_buf(s, b->debug.pc2column_buf, b->debug.pc2column_len)) -+ goto fail; -+ } - #ifdef DUMP_READ_OBJECT - bc_read_trace(s, "filename: "); print_atom(s->ctx, b->debug.filename); printf("\n"); - #endif -@@ -38674,6 +38987,7 @@ static const JSCFunctionListEntry js_function_proto_funcs[] = { - JS_CFUNC_DEF("[Symbol.hasInstance]", 1, js_function_hasInstance ), - JS_CGETSET_DEF("fileName", js_function_proto_fileName, NULL ), - JS_CGETSET_DEF("lineNumber", js_function_proto_lineNumber, NULL ), -+ JS_CGETSET_DEF("columnNumber", js_function_proto_columnNumber, NULL), - }; - - /* Error class */ -@@ -38783,7 +39097,7 @@ static JSValue js_error_constructor(JSContext *ctx, JSValueConst new_target, - } - - /* skip the Error() function in the backtrace */ -- build_backtrace(ctx, obj, NULL, 0, JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL); -+ build_backtrace(ctx, obj, NULL, 0, 0, JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL); - return obj; - exception: - JS_FreeValue(ctx, obj); -diff --git a/quickjs.h b/quickjs.h -index 7199936..1986647 100644 ---- a/quickjs.h -+++ b/quickjs.h -@@ -410,6 +410,7 @@ typedef struct JSMemoryUsage { - int64_t shape_count, shape_size; - int64_t js_func_count, js_func_size, js_func_code_size; - int64_t js_func_pc2line_count, js_func_pc2line_size; -+ int64_t js_func_pc2column_count, js_func_pc2column_size; - int64_t c_func_count, array_count; - int64_t fast_array_count, fast_array_elements; - int64_t binary_object_count, binary_object_size; -diff --git a/tests/test_line_column.js b/tests/test_line_column.js -new file mode 100644 -index 0000000..4301ee0 ---- /dev/null -+++ b/tests/test_line_column.js -@@ -0,0 +1,240 @@ -+"use strict"; -+ -+function assert(actual, expected, message) { -+ if (arguments.length == 1) expected = true; -+ -+ if (actual === expected) return; -+ -+ if (actual !== null && expected !== null && typeof actual == 'object' && -+ typeof expected == 'object' && actual.toString() === expected.toString()) -+ return; -+ -+ throw Error( -+ 'assertion failed: got |' + actual + '|' + -+ ', expected |' + expected + '|' + (message ? ' (' + message + ')' : '')); -+} -+ -+/** id not exists -> should be located at id */ -+function test_line_column1() { -+ try { -+ eval(`'【';A;`); -+ } catch (e) { -+ assert(e.lineNumber, 1, 'test_line_column1'); -+ assert(e.columnNumber, 5, 'test_line_column1'); -+ } -+} -+ -+/** -+ * memeber call should be located at id: -+ * a.b.c() and c is null -> c will be located -+ */ -+function test_line_column2() { -+ try { -+ eval(` -+var a = { b: { c: { d: null }} }; -+a.b.c.d(); -+ `); -+ } catch (e) { -+ assert(e.lineNumber, 3, 'test_line_column2'); -+ assert(e.columnNumber, 7, 'test_line_column2'); -+ } -+} -+ -+/** -+ * memeber call should be located at id: -+ * a.b.c() and b is null -> c will be located -+ */ -+function test_line_column3() { -+ try { -+ eval(` -+var a = { b: { c: { d: null }} }; -+a.f.c.d(); -+ `); -+ } catch (e) { -+ assert(e.lineNumber, 3, 'test_line_column3'); -+ assert(e.columnNumber, 5, 'test_line_column3'); -+ } -+} -+ -+/** if id not exists -> should be located at id */ -+function test_line_column4() { -+ try { -+ eval(`(function(){'use strict';a;}());`); -+ } catch (e) { -+ assert(e.lineNumber, 1, 'test_line_column4'); -+ assert(e.columnNumber, 26, 'test_line_column4'); -+ } -+} -+ -+/** if id not exists -> should be located at id */ -+function test_line_column5() { -+ try { -+ eval(`'【';1+1;new A();`); -+ } catch (e) { -+ assert(e.lineNumber, 1, 'test_line_column5'); -+ assert(e.columnNumber, 13, 'test_line_column5'); -+ } -+} -+ -+/** new call should be located at 'new' */ -+function test_line_column6() { -+ try { -+ eval(`'【';1+1;throw new Error();`); -+ } catch (e) { -+ assert(e.lineNumber, 1, 'test_line_column6'); -+ assert(e.columnNumber, 15, 'test_line_column6'); -+ } -+} -+ -+/** -+ * normal call should be located at function name: -+ * a() and a is null or occur error -> a will be located -+ */ -+function test_line_column7() { -+ try { -+ eval(`1+1;a();`); -+ } catch (e) { -+ assert(e.lineNumber, 1, 'test_line_column7'); -+ assert(e.columnNumber, 5, 'test_line_column7'); -+ } -+} -+ -+/** -+ * if comment is first line, -+ * the line number of one line should be locate at next line -+ */ -+function test_line_column8() { -+ try { -+ eval(` -+/** -+ * something -+ * comment -+ * here -+ */ -+1+1;a(); -+ `); -+ } catch (e) { -+ assert(e.lineNumber, 7, 'test_line_column8'); -+ assert(e.columnNumber, 5, 'test_line_column8'); -+ } -+} -+ -+/** nest function call */ -+function test_line_column9() { -+ try { -+ eval(`(function(){'【'(function(){'use strict';a;}())}())`); -+ } catch (e) { -+ assert(e.lineNumber, 1, 'test_line_column9'); -+ assert(e.columnNumber, 41, 'test_line_column9'); -+ } -+} -+ -+/** multi function call */ -+function test_line_column10() { -+ try { -+ eval(` -+function a(){ -+ throw new Error(); -+} -+ -+function b(){ -+ a(); -+} -+ -+b(); -+ `); -+ } catch (e) { -+ assert(e.lineNumber, 3, 'test_line_column10'); -+ assert(e.columnNumber, 11, 'test_line_column10'); -+ } -+} -+ -+/** syntax error should be located at latest token position */ -+function test_line_column11() { -+ try { -+ eval(` -+var a = { -+ b: if(1){} -+} -+ `); -+ } catch (e) { -+ assert(e.lineNumber, 3, 'test_line_column11'); -+ assert(e.columnNumber, 7, 'test_line_column11'); -+ } -+} -+ -+/** string template cases */ -+function test_line_column12() { -+// case 1 -+ try { -+ eval(` -+var a = \`\$\{b;\} -+1+1 -+\`; -+ `); -+ } catch (e) { -+ assert(e.lineNumber, 2, 'test_line_column12'); -+ assert(e.columnNumber, 12, 'test_line_column12'); -+ } -+ -+// case 2 -+ try { -+ eval(` -+var a = \`1+1 -+\$\{b;\} -+2+2 -+\`; -+ `); -+ } catch (e) { -+ assert(e.lineNumber, 3, 'test_line_column12'); -+ assert(e.columnNumber, 3, 'test_line_column12'); -+ } -+ -+// case 3 -+ try { -+ eval(` -+var a = \`1+1 -+2+2 -+\${b\}\`; -+ `); -+ } catch (e) { -+ assert(e.lineNumber, 4, 'test_line_column12'); -+ assert(e.columnNumber, 3, 'test_line_column12'); -+ } -+ -+// case 4 -+ try { -+ eval(` -+var a = \`1+1 -+2+2 -+\${3+3\}\`;b; -+ `); -+ } catch (e) { -+ assert(e.lineNumber, 4, 'test_line_column12'); -+ assert(e.columnNumber, 9, 'test_line_column12'); -+ } -+} -+ -+/** dynamic Function parse error should be located the latest token */ -+function test_line_column13() { -+ try { -+ eval(`Function("===>", "a");`); -+ } catch (e) { -+ assert(e.lineNumber, 1, 'test_line_column13'); -+ assert(e.columnNumber, 20, 'test_line_column13'); -+ } -+} -+ -+test_line_column1(); -+test_line_column2(); -+test_line_column3(); -+test_line_column4(); -+test_line_column5(); -+test_line_column6(); -+test_line_column7(); -+test_line_column8(); -+test_line_column9(); -+test_line_column10(); -+test_line_column11(); -+test_line_column12(); -+test_line_column13(); -\ No newline at end of file diff --git a/sys/patches/get_function_proto.patch b/sys/patches/get_function_proto.patch deleted file mode 100644 index 54923394..00000000 --- a/sys/patches/get_function_proto.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/quickjs.c b/quickjs.c -index e8fdd8a..fbd48bd 100644 ---- a/quickjs.c -+++ b/quickjs.c -@@ -2215,6 +2215,11 @@ JSValue JS_GetClassProto(JSContext *ctx, JSClassID class_id) - return JS_DupValue(ctx, ctx->class_proto[class_id]); - } - -+JSValueConst JS_GetFunctionProto(JSContext *ctx) -+{ -+ return ctx->function_proto; -+} -+ - typedef enum JSFreeModuleEnum { - JS_FREE_MODULE_ALL, - JS_FREE_MODULE_NOT_RESOLVED, -diff --git a/quickjs.h b/quickjs.h -index 7199936..d9e78ef 100644 ---- a/quickjs.h -+++ b/quickjs.h -@@ -358,6 +358,7 @@ void JS_SetContextOpaque(JSContext *ctx, void *opaque); - JSRuntime *JS_GetRuntime(JSContext *ctx); - void JS_SetClassProto(JSContext *ctx, JSClassID class_id, JSValue obj); - JSValue JS_GetClassProto(JSContext *ctx, JSClassID class_id); -+JSValueConst JS_GetFunctionProto(JSContext *ctx); - - /* the following functions are used to select the intrinsic object to - save memory */ diff --git a/sys/patches/infinity_handling.patch b/sys/patches/infinity_handling.patch deleted file mode 100644 index 464b4c3e..00000000 --- a/sys/patches/infinity_handling.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/quickjs.c b/quickjs.c -index e8fdd8a..9e9b8db 100644 ---- a/quickjs.c -+++ b/quickjs.c -@@ -10286,7 +10286,7 @@ static JSValue js_atof(JSContext *ctx, const char *str, const char **pp, - } else - #endif - { -- double d = 1.0 / 0.0; -+ double d = INFINITY; - if (is_neg) - d = -d; - val = JS_NewFloat64(ctx, d); -@@ -43090,7 +43090,7 @@ static JSValue js_math_min_max(JSContext *ctx, JSValueConst this_val, - uint32_t tag; - - if (unlikely(argc == 0)) { -- return __JS_NewFloat64(ctx, is_max ? -1.0 / 0.0 : 1.0 / 0.0); -+ return __JS_NewFloat64(ctx, is_max ? -INFINITY : INFINITY); - } - - tag = JS_VALUE_GET_TAG(argv[0]); -@@ -49418,7 +49418,7 @@ static const JSCFunctionListEntry js_global_funcs[] = { - JS_CFUNC_MAGIC_DEF("encodeURIComponent", 1, js_global_encodeURI, 1 ), - JS_CFUNC_DEF("escape", 1, js_global_escape ), - JS_CFUNC_DEF("unescape", 1, js_global_unescape ), -- JS_PROP_DOUBLE_DEF("Infinity", 1.0 / 0.0, 0 ), -+ JS_PROP_DOUBLE_DEF("Infinity", INFINITY, 0 ), - JS_PROP_DOUBLE_DEF("NaN", NAN, 0 ), - JS_PROP_UNDEFINED_DEF("undefined", 0 ), - JS_PROP_STRING_DEF("[Symbol.toStringTag]", "global", JS_PROP_CONFIGURABLE ), diff --git a/sys/quickjs b/sys/quickjs index 6e2e68fd..e569f39b 160000 --- a/sys/quickjs +++ b/sys/quickjs @@ -1 +1 @@ -Subproject commit 6e2e68fd0896957f92eb6c242a2e048c1ef3cae0 +Subproject commit e569f39bf18b4670dd526b11ea09cd00d7be3e91 diff --git a/sys/src/bindings/aarch64-apple-darwin.rs b/sys/src/bindings/aarch64-apple-darwin.rs index 9cb96e73..6934033d 100644 --- a/sys/src/bindings/aarch64-apple-darwin.rs +++ b/sys/src/bindings/aarch64-apple-darwin.rs @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -83,10 +86,8 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; pub const JS_TAG_STRING: _bindgen_ty_1 = -7; pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; @@ -102,36 +103,6 @@ pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSRefCountHeader), - "::", - stringify!(ref_count) - ) - ); -} -#[repr(C)] #[derive(Copy, Clone)] pub union JSValueUnion { pub int32: i32, @@ -253,79 +224,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -339,7 +257,7 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 40usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( @@ -348,8 +266,18 @@ fn bindgen_test_layout_JSMallocFunctions() { concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -359,7 +287,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -369,7 +297,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -379,7 +307,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 24usize, + 32usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -402,6 +330,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -476,9 +410,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -504,16 +435,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); +} +extern "C" { + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -523,6 +469,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -545,6 +498,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -609,8 +569,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -624,7 +582,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -832,29 +790,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -864,7 +802,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -874,7 +812,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -884,7 +822,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -894,7 +832,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -904,7 +842,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -1292,7 +1230,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1307,6 +1245,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1319,6 +1260,9 @@ extern "C" { extern "C" { pub fn JS_GetException(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_HasException(ctx: *mut JSContext) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } @@ -1328,6 +1272,13 @@ extern "C" { extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1367,10 +1318,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); +} +extern "C" { + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; +} +extern "C" { + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1395,6 +1352,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1409,9 +1373,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1471,13 +1432,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1487,16 +1448,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1554,6 +1510,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1571,6 +1534,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1703,20 +1669,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1753,6 +1713,12 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; +} extern "C" { pub fn JS_GetTypedArrayBuffer( ctx: *mut JSContext, @@ -1762,6 +1728,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1854,6 +1836,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1950,6 +1939,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1964,8 +1994,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1976,6 +2005,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2662,6 +2700,9 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; pub const JS_ATOM_null: _bindgen_ty_2 = 1; pub const JS_ATOM_false: _bindgen_ty_2 = 2; @@ -2710,185 +2751,178 @@ pub const JS_ATOM_static: _bindgen_ty_2 = 44; pub const JS_ATOM_yield: _bindgen_ty_2 = 45; pub const JS_ATOM_await: _bindgen_ty_2 = 46; pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 119; +pub const JS_ATOM_brand: _bindgen_ty_2 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 121; +pub const JS_ATOM_as: _bindgen_ty_2 = 122; +pub const JS_ATOM_from: _bindgen_ty_2 = 123; +pub const JS_ATOM_meta: _bindgen_ty_2 = 124; +pub const JS_ATOM__default_: _bindgen_ty_2 = 125; +pub const JS_ATOM__star_: _bindgen_ty_2 = 126; +pub const JS_ATOM_Module: _bindgen_ty_2 = 127; +pub const JS_ATOM_then: _bindgen_ty_2 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 129; +pub const JS_ATOM_reject: _bindgen_ty_2 = 130; +pub const JS_ATOM_promise: _bindgen_ty_2 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 133; +pub const JS_ATOM_async: _bindgen_ty_2 = 134; +pub const JS_ATOM_exec: _bindgen_ty_2 = 135; +pub const JS_ATOM_groups: _bindgen_ty_2 = 136; +pub const JS_ATOM_indices: _bindgen_ty_2 = 137; +pub const JS_ATOM_status: _bindgen_ty_2 = 138; +pub const JS_ATOM_reason: _bindgen_ty_2 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 143; +pub const JS_ATOM_ok: _bindgen_ty_2 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 145; +pub const JS_ATOM_Object: _bindgen_ty_2 = 146; +pub const JS_ATOM_Array: _bindgen_ty_2 = 147; +pub const JS_ATOM_Error: _bindgen_ty_2 = 148; +pub const JS_ATOM_Number: _bindgen_ty_2 = 149; +pub const JS_ATOM_String: _bindgen_ty_2 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 153; +pub const JS_ATOM_Math: _bindgen_ty_2 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 155; +pub const JS_ATOM_Date: _bindgen_ty_2 = 156; +pub const JS_ATOM_Function: _bindgen_ty_2 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 178; +pub const JS_ATOM_Map: _bindgen_ty_2 = 179; +pub const JS_ATOM_Set: _bindgen_ty_2 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 220; +pub const JS_ATOM_END: _bindgen_ty_2 = 221; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; diff --git a/sys/src/bindings/aarch64-unknown-linux-gnu.rs b/sys/src/bindings/aarch64-unknown-linux-gnu.rs index 567b297d..fa0f0103 100644 --- a/sys/src/bindings/aarch64-unknown-linux-gnu.rs +++ b/sys/src/bindings/aarch64-unknown-linux-gnu.rs @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -82,10 +85,8 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; pub const JS_TAG_STRING: _bindgen_ty_1 = -7; pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; @@ -101,36 +102,6 @@ pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSRefCountHeader), - "::", - stringify!(ref_count) - ) - ); -} -#[repr(C)] #[derive(Copy, Clone)] pub union JSValueUnion { pub int32: i32, @@ -252,79 +223,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -338,7 +256,7 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 40usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( @@ -347,8 +265,18 @@ fn bindgen_test_layout_JSMallocFunctions() { concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -358,7 +286,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -368,7 +296,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -378,7 +306,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 24usize, + 32usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -401,6 +329,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -475,9 +409,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -503,16 +434,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); +} +extern "C" { + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -522,6 +468,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -544,6 +497,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -608,8 +568,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -623,7 +581,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -831,29 +789,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -863,7 +801,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -873,7 +811,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -883,7 +821,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -893,7 +831,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -903,7 +841,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -1291,7 +1229,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1306,6 +1244,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1318,6 +1259,9 @@ extern "C" { extern "C" { pub fn JS_GetException(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_HasException(ctx: *mut JSContext) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } @@ -1327,6 +1271,13 @@ extern "C" { extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1366,10 +1317,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); +} +extern "C" { + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; +} +extern "C" { + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1394,6 +1351,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1408,9 +1372,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1470,13 +1431,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1486,16 +1447,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1553,6 +1509,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1570,6 +1533,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1702,20 +1668,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1752,6 +1712,12 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; +} extern "C" { pub fn JS_GetTypedArrayBuffer( ctx: *mut JSContext, @@ -1761,6 +1727,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1853,6 +1835,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1949,6 +1938,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1963,8 +1993,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1975,6 +2004,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2661,6 +2699,9 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; pub const JS_ATOM_null: _bindgen_ty_2 = 1; pub const JS_ATOM_false: _bindgen_ty_2 = 2; @@ -2709,185 +2750,178 @@ pub const JS_ATOM_static: _bindgen_ty_2 = 44; pub const JS_ATOM_yield: _bindgen_ty_2 = 45; pub const JS_ATOM_await: _bindgen_ty_2 = 46; pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 119; +pub const JS_ATOM_brand: _bindgen_ty_2 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 121; +pub const JS_ATOM_as: _bindgen_ty_2 = 122; +pub const JS_ATOM_from: _bindgen_ty_2 = 123; +pub const JS_ATOM_meta: _bindgen_ty_2 = 124; +pub const JS_ATOM__default_: _bindgen_ty_2 = 125; +pub const JS_ATOM__star_: _bindgen_ty_2 = 126; +pub const JS_ATOM_Module: _bindgen_ty_2 = 127; +pub const JS_ATOM_then: _bindgen_ty_2 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 129; +pub const JS_ATOM_reject: _bindgen_ty_2 = 130; +pub const JS_ATOM_promise: _bindgen_ty_2 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 133; +pub const JS_ATOM_async: _bindgen_ty_2 = 134; +pub const JS_ATOM_exec: _bindgen_ty_2 = 135; +pub const JS_ATOM_groups: _bindgen_ty_2 = 136; +pub const JS_ATOM_indices: _bindgen_ty_2 = 137; +pub const JS_ATOM_status: _bindgen_ty_2 = 138; +pub const JS_ATOM_reason: _bindgen_ty_2 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 143; +pub const JS_ATOM_ok: _bindgen_ty_2 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 145; +pub const JS_ATOM_Object: _bindgen_ty_2 = 146; +pub const JS_ATOM_Array: _bindgen_ty_2 = 147; +pub const JS_ATOM_Error: _bindgen_ty_2 = 148; +pub const JS_ATOM_Number: _bindgen_ty_2 = 149; +pub const JS_ATOM_String: _bindgen_ty_2 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 153; +pub const JS_ATOM_Math: _bindgen_ty_2 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 155; +pub const JS_ATOM_Date: _bindgen_ty_2 = 156; +pub const JS_ATOM_Function: _bindgen_ty_2 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 178; +pub const JS_ATOM_Map: _bindgen_ty_2 = 179; +pub const JS_ATOM_Set: _bindgen_ty_2 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 220; +pub const JS_ATOM_END: _bindgen_ty_2 = 221; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; diff --git a/sys/src/bindings/aarch64-unknown-linux-musl.rs b/sys/src/bindings/aarch64-unknown-linux-musl.rs index 567b297d..fa0f0103 100644 --- a/sys/src/bindings/aarch64-unknown-linux-musl.rs +++ b/sys/src/bindings/aarch64-unknown-linux-musl.rs @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -82,10 +85,8 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; pub const JS_TAG_STRING: _bindgen_ty_1 = -7; pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; @@ -101,36 +102,6 @@ pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSRefCountHeader), - "::", - stringify!(ref_count) - ) - ); -} -#[repr(C)] #[derive(Copy, Clone)] pub union JSValueUnion { pub int32: i32, @@ -252,79 +223,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -338,7 +256,7 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 40usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( @@ -347,8 +265,18 @@ fn bindgen_test_layout_JSMallocFunctions() { concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -358,7 +286,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -368,7 +296,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -378,7 +306,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 24usize, + 32usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -401,6 +329,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -475,9 +409,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -503,16 +434,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); +} +extern "C" { + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -522,6 +468,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -544,6 +497,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -608,8 +568,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -623,7 +581,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -831,29 +789,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -863,7 +801,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -873,7 +811,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -883,7 +821,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -893,7 +831,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -903,7 +841,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -1291,7 +1229,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1306,6 +1244,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1318,6 +1259,9 @@ extern "C" { extern "C" { pub fn JS_GetException(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_HasException(ctx: *mut JSContext) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } @@ -1327,6 +1271,13 @@ extern "C" { extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1366,10 +1317,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); +} +extern "C" { + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; +} +extern "C" { + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1394,6 +1351,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1408,9 +1372,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1470,13 +1431,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1486,16 +1447,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1553,6 +1509,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1570,6 +1533,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1702,20 +1668,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1752,6 +1712,12 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; +} extern "C" { pub fn JS_GetTypedArrayBuffer( ctx: *mut JSContext, @@ -1761,6 +1727,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1853,6 +1835,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1949,6 +1938,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1963,8 +1993,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1975,6 +2004,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2661,6 +2699,9 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; pub const JS_ATOM_null: _bindgen_ty_2 = 1; pub const JS_ATOM_false: _bindgen_ty_2 = 2; @@ -2709,185 +2750,178 @@ pub const JS_ATOM_static: _bindgen_ty_2 = 44; pub const JS_ATOM_yield: _bindgen_ty_2 = 45; pub const JS_ATOM_await: _bindgen_ty_2 = 46; pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 119; +pub const JS_ATOM_brand: _bindgen_ty_2 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 121; +pub const JS_ATOM_as: _bindgen_ty_2 = 122; +pub const JS_ATOM_from: _bindgen_ty_2 = 123; +pub const JS_ATOM_meta: _bindgen_ty_2 = 124; +pub const JS_ATOM__default_: _bindgen_ty_2 = 125; +pub const JS_ATOM__star_: _bindgen_ty_2 = 126; +pub const JS_ATOM_Module: _bindgen_ty_2 = 127; +pub const JS_ATOM_then: _bindgen_ty_2 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 129; +pub const JS_ATOM_reject: _bindgen_ty_2 = 130; +pub const JS_ATOM_promise: _bindgen_ty_2 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 133; +pub const JS_ATOM_async: _bindgen_ty_2 = 134; +pub const JS_ATOM_exec: _bindgen_ty_2 = 135; +pub const JS_ATOM_groups: _bindgen_ty_2 = 136; +pub const JS_ATOM_indices: _bindgen_ty_2 = 137; +pub const JS_ATOM_status: _bindgen_ty_2 = 138; +pub const JS_ATOM_reason: _bindgen_ty_2 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 143; +pub const JS_ATOM_ok: _bindgen_ty_2 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 145; +pub const JS_ATOM_Object: _bindgen_ty_2 = 146; +pub const JS_ATOM_Array: _bindgen_ty_2 = 147; +pub const JS_ATOM_Error: _bindgen_ty_2 = 148; +pub const JS_ATOM_Number: _bindgen_ty_2 = 149; +pub const JS_ATOM_String: _bindgen_ty_2 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 153; +pub const JS_ATOM_Math: _bindgen_ty_2 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 155; +pub const JS_ATOM_Date: _bindgen_ty_2 = 156; +pub const JS_ATOM_Function: _bindgen_ty_2 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 178; +pub const JS_ATOM_Map: _bindgen_ty_2 = 179; +pub const JS_ATOM_Set: _bindgen_ty_2 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 220; +pub const JS_ATOM_END: _bindgen_ty_2 = 221; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; diff --git a/sys/src/bindings/i686-pc-windows-gnu.rs b/sys/src/bindings/i686-pc-windows-gnu.rs deleted file mode 100644 index 64dc4699..00000000 --- a/sys/src/bindings/i686-pc-windows-gnu.rs +++ /dev/null @@ -1,2801 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -pub const JS_PROP_CONFIGURABLE: u32 = 1; -pub const JS_PROP_WRITABLE: u32 = 2; -pub const JS_PROP_ENUMERABLE: u32 = 4; -pub const JS_PROP_C_W_E: u32 = 7; -pub const JS_PROP_LENGTH: u32 = 8; -pub const JS_PROP_TMASK: u32 = 48; -pub const JS_PROP_NORMAL: u32 = 0; -pub const JS_PROP_GETSET: u32 = 16; -pub const JS_PROP_VARREF: u32 = 32; -pub const JS_PROP_AUTOINIT: u32 = 48; -pub const JS_PROP_HAS_SHIFT: u32 = 8; -pub const JS_PROP_HAS_CONFIGURABLE: u32 = 256; -pub const JS_PROP_HAS_WRITABLE: u32 = 512; -pub const JS_PROP_HAS_ENUMERABLE: u32 = 1024; -pub const JS_PROP_HAS_GET: u32 = 2048; -pub const JS_PROP_HAS_SET: u32 = 4096; -pub const JS_PROP_HAS_VALUE: u32 = 8192; -pub const JS_PROP_THROW: u32 = 16384; -pub const JS_PROP_THROW_STRICT: u32 = 32768; -pub const JS_PROP_NO_ADD: u32 = 65536; -pub const JS_PROP_NO_EXOTIC: u32 = 131072; -pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; -pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; -pub const JS_EVAL_TYPE_MODULE: u32 = 1; -pub const JS_EVAL_TYPE_DIRECT: u32 = 2; -pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; -pub const JS_EVAL_TYPE_MASK: u32 = 3; -pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; -pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; -pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; -pub const JS_EVAL_FLAG_ASYNC: u32 = 128; -pub const JS_ATOM_NULL: u32 = 0; -pub const JS_CALL_FLAG_CONSTRUCTOR: u32 = 1; -pub const JS_INVALID_CLASS_ID: u32 = 0; -pub const JS_GPN_STRING_MASK: u32 = 1; -pub const JS_GPN_SYMBOL_MASK: u32 = 2; -pub const JS_GPN_PRIVATE_MASK: u32 = 4; -pub const JS_GPN_ENUM_ONLY: u32 = 16; -pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; -pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; -pub const JS_WRITE_OBJ_SAB: u32 = 4; -pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; -pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; -pub const JS_READ_OBJ_SAB: u32 = 4; -pub const JS_READ_OBJ_REFERENCE: u32 = 8; -pub const JS_DEF_CFUNC: u32 = 0; -pub const JS_DEF_CGETSET: u32 = 1; -pub const JS_DEF_CGETSET_MAGIC: u32 = 2; -pub const JS_DEF_PROP_STRING: u32 = 3; -pub const JS_DEF_PROP_INT32: u32 = 4; -pub const JS_DEF_PROP_INT64: u32 = 5; -pub const JS_DEF_PROP_DOUBLE: u32 = 6; -pub const JS_DEF_PROP_UNDEFINED: u32 = 7; -pub const JS_DEF_OBJECT: u32 = 8; -pub const JS_DEF_ALIAS: u32 = 9; -pub type size_t = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRuntime { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSContext { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSObject { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSClass { - _unused: [u8; 0], -} -pub type JSClassID = u32; -pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; -pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; -pub const JS_TAG_STRING: _bindgen_ty_1 = -7; -pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; -pub const JS_TAG_FUNCTION_BYTECODE: _bindgen_ty_1 = -2; -pub const JS_TAG_OBJECT: _bindgen_ty_1 = -1; -pub const JS_TAG_INT: _bindgen_ty_1 = 0; -pub const JS_TAG_BOOL: _bindgen_ty_1 = 1; -pub const JS_TAG_NULL: _bindgen_ty_1 = 2; -pub const JS_TAG_UNDEFINED: _bindgen_ty_1 = 3; -pub const JS_TAG_UNINITIALIZED: _bindgen_ty_1 = 4; -pub const JS_TAG_CATCH_OFFSET: _bindgen_ty_1 = 5; -pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; -pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; -pub type _bindgen_ty_1 = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSRefCountHeader), - "::", - stringify!(ref_count) - ) - ); -} -pub type JSValue = u64; -pub type JSCFunction = ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - this_val: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - ) -> JSValue, ->; -pub type JSCFunctionMagic = ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - this_val: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - magic: ::std::os::raw::c_int, - ) -> JSValue, ->; -pub type JSCFunctionData = ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - this_val: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - magic: ::std::os::raw::c_int, - func_data: *mut JSValue, - ) -> JSValue, ->; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSMallocFunctions { - pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, - >, - pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), - >, - pub js_realloc: ::std::option::Option< - unsafe extern "C" fn( - s: *mut JSMallocState, - ptr: *mut ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, - >, - pub js_malloc_usable_size: - ::std::option::Option size_t>, -} -#[test] -fn bindgen_test_layout_JSMallocFunctions() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JSMallocFunctions)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSMallocFunctions)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocFunctions), - "::", - stringify!(js_malloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSMallocFunctions), - "::", - stringify!(js_free) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocFunctions), - "::", - stringify!(js_realloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JSMallocFunctions), - "::", - stringify!(js_malloc_usable_size) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSGCObjectHeader { - _unused: [u8; 0], -} -extern "C" { - pub fn JS_NewRuntime() -> *mut JSRuntime; -} -extern "C" { - pub fn JS_SetRuntimeInfo(rt: *mut JSRuntime, info: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); -} -extern "C" { - pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); -} -extern "C" { - pub fn JS_SetMaxStackSize(rt: *mut JSRuntime, stack_size: size_t); -} -extern "C" { - pub fn JS_UpdateStackTop(rt: *mut JSRuntime); -} -extern "C" { - pub fn JS_NewRuntime2( - mf: *const JSMallocFunctions, - opaque: *mut ::std::os::raw::c_void, - ) -> *mut JSRuntime; -} -extern "C" { - pub fn JS_FreeRuntime(rt: *mut JSRuntime); -} -extern "C" { - pub fn JS_GetRuntimeOpaque(rt: *mut JSRuntime) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn JS_SetRuntimeOpaque(rt: *mut JSRuntime, opaque: *mut ::std::os::raw::c_void); -} -pub type JS_MarkFunc = - ::std::option::Option; -extern "C" { - pub fn JS_MarkValue(rt: *mut JSRuntime, val: JSValue, mark_func: JS_MarkFunc); -} -extern "C" { - pub fn JS_RunGC(rt: *mut JSRuntime); -} -extern "C" { - pub fn JS_IsLiveObject(rt: *mut JSRuntime, obj: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_NewContext(rt: *mut JSRuntime) -> *mut JSContext; -} -extern "C" { - pub fn JS_FreeContext(s: *mut JSContext); -} -extern "C" { - pub fn JS_DupContext(ctx: *mut JSContext) -> *mut JSContext; -} -extern "C" { - pub fn JS_GetContextOpaque(ctx: *mut JSContext) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn JS_SetContextOpaque(ctx: *mut JSContext, opaque: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn JS_GetRuntime(ctx: *mut JSContext) -> *mut JSRuntime; -} -extern "C" { - pub fn JS_SetClassProto(ctx: *mut JSContext, class_id: JSClassID, obj: JSValue); -} -extern "C" { - pub fn JS_GetClassProto(ctx: *mut JSContext, class_id: JSClassID) -> JSValue; -} -extern "C" { - pub fn JS_GetFunctionProto(ctx: *mut JSContext) -> JSValue; -} -extern "C" { - pub fn JS_NewContextRaw(rt: *mut JSRuntime) -> *mut JSContext; -} -extern "C" { - pub fn JS_AddIntrinsicBaseObjects(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicDate(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicRegExp(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicJSON(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicProxy(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicMapSet(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicTypedArrays(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicPromise(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); -} -extern "C" { - pub fn js_string_codePointRange( - ctx: *mut JSContext, - this_val: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - ) -> JSValue; -} -extern "C" { - pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn js_free_rt(rt: *mut JSRuntime, ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn js_realloc_rt( - rt: *mut JSRuntime, - ptr: *mut ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn js_malloc_usable_size_rt( - rt: *mut JSRuntime, - ptr: *const ::std::os::raw::c_void, - ) -> size_t; -} -extern "C" { - pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn js_free(ctx: *mut JSContext, ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn js_realloc( - ctx: *mut JSContext, - ptr: *mut ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn js_malloc_usable_size(ctx: *mut JSContext, ptr: *const ::std::os::raw::c_void) - -> size_t; -} -extern "C" { - pub fn js_realloc2( - ctx: *mut JSContext, - ptr: *mut ::std::os::raw::c_void, - size: size_t, - pslack: *mut size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn js_mallocz(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn js_strdup( - ctx: *mut JSContext, - str_: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn js_strndup( - ctx: *mut JSContext, - s: *const ::std::os::raw::c_char, - n: size_t, - ) -> *mut ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSMemoryUsage { - pub malloc_size: i64, - pub malloc_limit: i64, - pub memory_used_size: i64, - pub malloc_count: i64, - pub memory_used_count: i64, - pub atom_count: i64, - pub atom_size: i64, - pub str_count: i64, - pub str_size: i64, - pub obj_count: i64, - pub obj_size: i64, - pub prop_count: i64, - pub prop_size: i64, - pub shape_count: i64, - pub shape_size: i64, - pub js_func_count: i64, - pub js_func_size: i64, - pub js_func_code_size: i64, - pub js_func_pc2line_count: i64, - pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, - pub c_func_count: i64, - pub array_count: i64, - pub fast_array_count: i64, - pub fast_array_elements: i64, - pub binary_object_count: i64, - pub binary_object_size: i64, -} -#[test] -fn bindgen_test_layout_JSMemoryUsage() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 224usize, - concat!("Size of: ", stringify!(JSMemoryUsage)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSMemoryUsage)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).memory_used_size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(memory_used_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).memory_used_count) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(memory_used_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).atom_count) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(atom_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).atom_size) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(atom_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).str_count) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(str_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).str_size) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(str_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).obj_count) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(obj_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).obj_size) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(obj_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prop_count) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(prop_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prop_size) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(prop_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).shape_count) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(shape_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).shape_size) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(shape_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_count) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_size) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_code_size) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_code_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2line_count) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2line_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2line_size) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2line_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(c_func_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(array_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(fast_array_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(fast_array_elements) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(binary_object_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(binary_object_size) - ) - ); -} -extern "C" { - pub fn JS_ComputeMemoryUsage(rt: *mut JSRuntime, s: *mut JSMemoryUsage); -} -extern "C" { - pub fn JS_NewAtomLen( - ctx: *mut JSContext, - str_: *const ::std::os::raw::c_char, - len: size_t, - ) -> JSAtom; -} -extern "C" { - pub fn JS_NewAtom(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSAtom; -} -extern "C" { - pub fn JS_NewAtomUInt32(ctx: *mut JSContext, n: u32) -> JSAtom; -} -extern "C" { - pub fn JS_DupAtom(ctx: *mut JSContext, v: JSAtom) -> JSAtom; -} -extern "C" { - pub fn JS_FreeAtom(ctx: *mut JSContext, v: JSAtom); -} -extern "C" { - pub fn JS_FreeAtomRT(rt: *mut JSRuntime, v: JSAtom); -} -extern "C" { - pub fn JS_AtomToValue(ctx: *mut JSContext, atom: JSAtom) -> JSValue; -} -extern "C" { - pub fn JS_AtomToString(ctx: *mut JSContext, atom: JSAtom) -> JSValue; -} -extern "C" { - pub fn JS_AtomToCString(ctx: *mut JSContext, atom: JSAtom) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn JS_ValueToAtom(ctx: *mut JSContext, val: JSValue) -> JSAtom; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSPropertyEnum { - pub is_enumerable: ::std::os::raw::c_int, - pub atom: JSAtom, -} -#[test] -fn bindgen_test_layout_JSPropertyEnum() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(JSPropertyEnum)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSPropertyEnum)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).is_enumerable) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSPropertyEnum), - "::", - stringify!(is_enumerable) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).atom) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSPropertyEnum), - "::", - stringify!(atom) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSPropertyDescriptor { - pub flags: ::std::os::raw::c_int, - pub value: JSValue, - pub getter: JSValue, - pub setter: JSValue, -} -#[test] -fn bindgen_test_layout_JSPropertyDescriptor() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(JSPropertyDescriptor)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSPropertyDescriptor)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSPropertyDescriptor), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSPropertyDescriptor), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).getter) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSPropertyDescriptor), - "::", - stringify!(getter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).setter) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSPropertyDescriptor), - "::", - stringify!(setter) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSClassExoticMethods { - pub get_own_property: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - desc: *mut JSPropertyDescriptor, - obj: JSValue, - prop: JSAtom, - ) -> ::std::os::raw::c_int, - >, - pub get_own_property_names: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - ptab: *mut *mut JSPropertyEnum, - plen: *mut u32, - obj: JSValue, - ) -> ::std::os::raw::c_int, - >, - pub delete_property: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - ) -> ::std::os::raw::c_int, - >, - pub define_own_property: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - this_obj: JSValue, - prop: JSAtom, - val: JSValue, - getter: JSValue, - setter: JSValue, - flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int, - >, - pub has_property: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - obj: JSValue, - atom: JSAtom, - ) -> ::std::os::raw::c_int, - >, - pub get_property: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - obj: JSValue, - atom: JSAtom, - receiver: JSValue, - ) -> JSValue, - >, - pub set_property: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - obj: JSValue, - atom: JSAtom, - value: JSValue, - receiver: JSValue, - flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int, - >, -} -#[test] -fn bindgen_test_layout_JSClassExoticMethods() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(JSClassExoticMethods)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSClassExoticMethods)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).get_own_property) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSClassExoticMethods), - "::", - stringify!(get_own_property) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).get_own_property_names) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSClassExoticMethods), - "::", - stringify!(get_own_property_names) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).delete_property) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSClassExoticMethods), - "::", - stringify!(delete_property) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).define_own_property) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JSClassExoticMethods), - "::", - stringify!(define_own_property) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).has_property) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSClassExoticMethods), - "::", - stringify!(has_property) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).get_property) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(JSClassExoticMethods), - "::", - stringify!(get_property) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_property) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSClassExoticMethods), - "::", - stringify!(set_property) - ) - ); -} -pub type JSClassFinalizer = - ::std::option::Option; -pub type JSClassGCMark = ::std::option::Option< - unsafe extern "C" fn(rt: *mut JSRuntime, val: JSValue, mark_func: JS_MarkFunc), ->; -pub type JSClassCall = ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - func_obj: JSValue, - this_val: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - flags: ::std::os::raw::c_int, - ) -> JSValue, ->; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSClassDef { - pub class_name: *const ::std::os::raw::c_char, - pub finalizer: JSClassFinalizer, - pub gc_mark: JSClassGCMark, - pub call: JSClassCall, - pub exotic: *mut JSClassExoticMethods, -} -#[test] -fn bindgen_test_layout_JSClassDef() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(JSClassDef)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSClassDef)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).class_name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSClassDef), - "::", - stringify!(class_name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).finalizer) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSClassDef), - "::", - stringify!(finalizer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gc_mark) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSClassDef), - "::", - stringify!(gc_mark) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).call) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JSClassDef), - "::", - stringify!(call) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exotic) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSClassDef), - "::", - stringify!(exotic) - ) - ); -} -extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; -} -extern "C" { - pub fn JS_GetClassID(v: JSValue) -> JSClassID; -} -extern "C" { - pub fn JS_NewClass( - rt: *mut JSRuntime, - class_id: JSClassID, - class_def: *const JSClassDef, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; -} -extern "C" { - pub fn JS_NewBigUint64(ctx: *mut JSContext, v: u64) -> JSValue; -} -extern "C" { - pub fn JS_Throw(ctx: *mut JSContext, obj: JSValue) -> JSValue; -} -extern "C" { - pub fn JS_GetException(ctx: *mut JSContext) -> JSValue; -} -extern "C" { - pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_ResetUncatchableError(ctx: *mut JSContext); -} -extern "C" { - pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; -} -extern "C" { - pub fn JS_ThrowSyntaxError( - ctx: *mut JSContext, - fmt: *const ::std::os::raw::c_char, - ... - ) -> JSValue; -} -extern "C" { - pub fn JS_ThrowTypeError( - ctx: *mut JSContext, - fmt: *const ::std::os::raw::c_char, - ... - ) -> JSValue; -} -extern "C" { - pub fn JS_ThrowReferenceError( - ctx: *mut JSContext, - fmt: *const ::std::os::raw::c_char, - ... - ) -> JSValue; -} -extern "C" { - pub fn JS_ThrowRangeError( - ctx: *mut JSContext, - fmt: *const ::std::os::raw::c_char, - ... - ) -> JSValue; -} -extern "C" { - pub fn JS_ThrowInternalError( - ctx: *mut JSContext, - fmt: *const ::std::os::raw::c_char, - ... - ) -> JSValue; -} -extern "C" { - pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; -} -extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); -} -extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); -} -extern "C" { - pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_ToInt32(ctx: *mut JSContext, pres: *mut i32, val: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_ToInt64(ctx: *mut JSContext, pres: *mut i64, val: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_ToIndex(ctx: *mut JSContext, plen: *mut u64, val: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_ToFloat64(ctx: *mut JSContext, pres: *mut f64, val: JSValue) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_ToBigInt64( - ctx: *mut JSContext, - pres: *mut i64, - val: JSValue, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_ToInt64Ext( - ctx: *mut JSContext, - pres: *mut i64, - val: JSValue, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_NewStringLen( - ctx: *mut JSContext, - str1: *const ::std::os::raw::c_char, - len1: size_t, - ) -> JSValue; -} -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} -extern "C" { - pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} -extern "C" { - pub fn JS_ToString(ctx: *mut JSContext, val: JSValue) -> JSValue; -} -extern "C" { - pub fn JS_ToPropertyKey(ctx: *mut JSContext, val: JSValue) -> JSValue; -} -extern "C" { - pub fn JS_ToCStringLen2( - ctx: *mut JSContext, - plen: *mut size_t, - val1: JSValue, - cesu8: ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn JS_FreeCString(ctx: *mut JSContext, ptr: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn JS_NewObjectProtoClass( - ctx: *mut JSContext, - proto: JSValue, - class_id: JSClassID, - ) -> JSValue; -} -extern "C" { - pub fn JS_NewObjectClass(ctx: *mut JSContext, class_id: ::std::os::raw::c_int) -> JSValue; -} -extern "C" { - pub fn JS_NewObjectProto(ctx: *mut JSContext, proto: JSValue) -> JSValue; -} -extern "C" { - pub fn JS_NewObject(ctx: *mut JSContext) -> JSValue; -} -extern "C" { - pub fn JS_IsFunction(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_IsConstructor(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_SetConstructorBit( - ctx: *mut JSContext, - func_obj: JSValue, - val: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_NewArray(ctx: *mut JSContext) -> JSValue; -} -extern "C" { - pub fn JS_IsArray(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; -} -extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; -} -extern "C" { - pub fn JS_GetPropertyStr( - ctx: *mut JSContext, - this_obj: JSValue, - prop: *const ::std::os::raw::c_char, - ) -> JSValue; -} -extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_SetPropertyUint32( - ctx: *mut JSContext, - this_obj: JSValue, - idx: u32, - val: JSValue, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_SetPropertyInt64( - ctx: *mut JSContext, - this_obj: JSValue, - idx: i64, - val: JSValue, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_SetPropertyStr( - ctx: *mut JSContext, - this_obj: JSValue, - prop: *const ::std::os::raw::c_char, - val: JSValue, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_HasProperty( - ctx: *mut JSContext, - this_obj: JSValue, - prop: JSAtom, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_IsExtensible(ctx: *mut JSContext, obj: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_PreventExtensions(ctx: *mut JSContext, obj: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_DeleteProperty( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_SetPrototype( - ctx: *mut JSContext, - obj: JSValue, - proto_val: JSValue, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; -} -extern "C" { - pub fn JS_GetOwnPropertyNames( - ctx: *mut JSContext, - ptab: *mut *mut JSPropertyEnum, - plen: *mut u32, - obj: JSValue, - flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_GetOwnProperty( - ctx: *mut JSContext, - desc: *mut JSPropertyDescriptor, - obj: JSValue, - prop: JSAtom, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_Call( - ctx: *mut JSContext, - func_obj: JSValue, - this_obj: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - ) -> JSValue; -} -extern "C" { - pub fn JS_Invoke( - ctx: *mut JSContext, - this_val: JSValue, - atom: JSAtom, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - ) -> JSValue; -} -extern "C" { - pub fn JS_CallConstructor( - ctx: *mut JSContext, - func_obj: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - ) -> JSValue; -} -extern "C" { - pub fn JS_CallConstructor2( - ctx: *mut JSContext, - func_obj: JSValue, - new_target: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - ) -> JSValue; -} -extern "C" { - pub fn JS_DetectModule( - input: *const ::std::os::raw::c_char, - input_len: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_Eval( - ctx: *mut JSContext, - input: *const ::std::os::raw::c_char, - input_len: size_t, - filename: *const ::std::os::raw::c_char, - eval_flags: ::std::os::raw::c_int, - ) -> JSValue; -} -extern "C" { - pub fn JS_EvalThis( - ctx: *mut JSContext, - this_obj: JSValue, - input: *const ::std::os::raw::c_char, - input_len: size_t, - filename: *const ::std::os::raw::c_char, - eval_flags: ::std::os::raw::c_int, - ) -> JSValue; -} -extern "C" { - pub fn JS_GetGlobalObject(ctx: *mut JSContext) -> JSValue; -} -extern "C" { - pub fn JS_IsInstanceOf( - ctx: *mut JSContext, - val: JSValue, - obj: JSValue, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_DefineProperty( - ctx: *mut JSContext, - this_obj: JSValue, - prop: JSAtom, - val: JSValue, - getter: JSValue, - setter: JSValue, - flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_DefinePropertyValue( - ctx: *mut JSContext, - this_obj: JSValue, - prop: JSAtom, - val: JSValue, - flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_DefinePropertyValueUint32( - ctx: *mut JSContext, - this_obj: JSValue, - idx: u32, - val: JSValue, - flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_DefinePropertyValueStr( - ctx: *mut JSContext, - this_obj: JSValue, - prop: *const ::std::os::raw::c_char, - val: JSValue, - flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_DefinePropertyGetSet( - ctx: *mut JSContext, - this_obj: JSValue, - prop: JSAtom, - getter: JSValue, - setter: JSValue, - flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_SetOpaque(obj: JSValue, opaque: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn JS_GetOpaque(obj: JSValue, class_id: JSClassID) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn JS_GetOpaque2( - ctx: *mut JSContext, - obj: JSValue, - class_id: JSClassID, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; -} -extern "C" { - pub fn JS_ParseJSON2( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, - ) -> JSValue; -} -extern "C" { - pub fn JS_JSONStringify( - ctx: *mut JSContext, - obj: JSValue, - replacer: JSValue, - space0: JSValue, - ) -> JSValue; -} -pub type JSFreeArrayBufferDataFunc = ::std::option::Option< - unsafe extern "C" fn( - rt: *mut JSRuntime, - opaque: *mut ::std::os::raw::c_void, - ptr: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub fn JS_NewArrayBuffer( - ctx: *mut JSContext, - buf: *mut u8, - len: size_t, - free_func: JSFreeArrayBufferDataFunc, - opaque: *mut ::std::os::raw::c_void, - is_shared: ::std::os::raw::c_int, - ) -> JSValue; -} -extern "C" { - pub fn JS_NewArrayBufferCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; -} -extern "C" { - pub fn JS_DetachArrayBuffer(ctx: *mut JSContext, obj: JSValue); -} -extern "C" { - pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; -} -extern "C" { - pub fn JS_GetTypedArrayBuffer( - ctx: *mut JSContext, - obj: JSValue, - pbyte_offset: *mut size_t, - pbyte_length: *mut size_t, - pbytes_per_element: *mut size_t, - ) -> JSValue; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSSharedArrayBufferFunctions { - pub sab_alloc: ::std::option::Option< - unsafe extern "C" fn( - opaque: *mut ::std::os::raw::c_void, - size: size_t, - ) -> *mut ::std::os::raw::c_void, - >, - pub sab_free: ::std::option::Option< - unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), - >, - pub sab_dup: ::std::option::Option< - unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), - >, - pub sab_opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSSharedArrayBufferFunctions() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JSSharedArrayBufferFunctions)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSSharedArrayBufferFunctions)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sab_alloc) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSSharedArrayBufferFunctions), - "::", - stringify!(sab_alloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sab_free) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSSharedArrayBufferFunctions), - "::", - stringify!(sab_free) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sab_dup) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSSharedArrayBufferFunctions), - "::", - stringify!(sab_dup) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sab_opaque) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JSSharedArrayBufferFunctions), - "::", - stringify!(sab_opaque) - ) - ); -} -extern "C" { - pub fn JS_SetSharedArrayBufferFunctions( - rt: *mut JSRuntime, - sf: *const JSSharedArrayBufferFunctions, - ); -} -pub const JSPromiseStateEnum_JS_PROMISE_PENDING: JSPromiseStateEnum = 0; -pub const JSPromiseStateEnum_JS_PROMISE_FULFILLED: JSPromiseStateEnum = 1; -pub const JSPromiseStateEnum_JS_PROMISE_REJECTED: JSPromiseStateEnum = 2; -pub type JSPromiseStateEnum = ::std::os::raw::c_uint; -extern "C" { - pub fn JS_NewPromiseCapability(ctx: *mut JSContext, resolving_funcs: *mut JSValue) -> JSValue; -} -extern "C" { - pub fn JS_PromiseState(ctx: *mut JSContext, promise: JSValue) -> JSPromiseStateEnum; -} -extern "C" { - pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; -} -pub type JSHostPromiseRejectionTracker = ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - promise: JSValue, - reason: JSValue, - is_handled: ::std::os::raw::c_int, - opaque: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub fn JS_SetHostPromiseRejectionTracker( - rt: *mut JSRuntime, - cb: JSHostPromiseRejectionTracker, - opaque: *mut ::std::os::raw::c_void, - ); -} -pub type JSInterruptHandler = ::std::option::Option< - unsafe extern "C" fn( - rt: *mut JSRuntime, - opaque: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int, ->; -extern "C" { - pub fn JS_SetInterruptHandler( - rt: *mut JSRuntime, - cb: JSInterruptHandler, - opaque: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn JS_SetCanBlock(rt: *mut JSRuntime, can_block: ::std::os::raw::c_int); -} -extern "C" { - pub fn JS_SetIsHTMLDDA(ctx: *mut JSContext, obj: JSValue); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSModuleDef { - _unused: [u8; 0], -} -pub type JSModuleNormalizeFunc = ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - module_base_name: *const ::std::os::raw::c_char, - module_name: *const ::std::os::raw::c_char, - opaque: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_char, ->; -pub type JSModuleLoaderFunc = ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - module_name: *const ::std::os::raw::c_char, - opaque: *mut ::std::os::raw::c_void, - ) -> *mut JSModuleDef, ->; -extern "C" { - pub fn JS_SetModuleLoaderFunc( - rt: *mut JSRuntime, - module_normalize: JSModuleNormalizeFunc, - module_loader: JSModuleLoaderFunc, - opaque: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn JS_GetImportMeta(ctx: *mut JSContext, m: *mut JSModuleDef) -> JSValue; -} -extern "C" { - pub fn JS_GetModuleName(ctx: *mut JSContext, m: *mut JSModuleDef) -> JSAtom; -} -extern "C" { - pub fn JS_GetModuleNamespace(ctx: *mut JSContext, m: *mut JSModuleDef) -> JSValue; -} -pub type JSJobFunc = ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - ) -> JSValue, ->; -extern "C" { - pub fn JS_EnqueueJob( - ctx: *mut JSContext, - job_func: JSJobFunc, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_IsJobPending(rt: *mut JSRuntime) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_ExecutePendingJob( - rt: *mut JSRuntime, - pctx: *mut *mut JSContext, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_WriteObject( - ctx: *mut JSContext, - psize: *mut size_t, - obj: JSValue, - flags: ::std::os::raw::c_int, - ) -> *mut u8; -} -extern "C" { - pub fn JS_WriteObject2( - ctx: *mut JSContext, - psize: *mut size_t, - obj: JSValue, - flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, - ) -> *mut u8; -} -extern "C" { - pub fn JS_ReadObject( - ctx: *mut JSContext, - buf: *const u8, - buf_len: size_t, - flags: ::std::os::raw::c_int, - ) -> JSValue; -} -extern "C" { - pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; -} -extern "C" { - pub fn JS_ResolveModule(ctx: *mut JSContext, obj: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_GetScriptOrModuleName( - ctx: *mut JSContext, - n_stack_levels: ::std::os::raw::c_int, - ) -> JSAtom; -} -extern "C" { - pub fn JS_LoadModule( - ctx: *mut JSContext, - basename: *const ::std::os::raw::c_char, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; -} -pub const JSCFunctionEnum_JS_CFUNC_generic: JSCFunctionEnum = 0; -pub const JSCFunctionEnum_JS_CFUNC_generic_magic: JSCFunctionEnum = 1; -pub const JSCFunctionEnum_JS_CFUNC_constructor: JSCFunctionEnum = 2; -pub const JSCFunctionEnum_JS_CFUNC_constructor_magic: JSCFunctionEnum = 3; -pub const JSCFunctionEnum_JS_CFUNC_constructor_or_func: JSCFunctionEnum = 4; -pub const JSCFunctionEnum_JS_CFUNC_constructor_or_func_magic: JSCFunctionEnum = 5; -pub const JSCFunctionEnum_JS_CFUNC_f_f: JSCFunctionEnum = 6; -pub const JSCFunctionEnum_JS_CFUNC_f_f_f: JSCFunctionEnum = 7; -pub const JSCFunctionEnum_JS_CFUNC_getter: JSCFunctionEnum = 8; -pub const JSCFunctionEnum_JS_CFUNC_setter: JSCFunctionEnum = 9; -pub const JSCFunctionEnum_JS_CFUNC_getter_magic: JSCFunctionEnum = 10; -pub const JSCFunctionEnum_JS_CFUNC_setter_magic: JSCFunctionEnum = 11; -pub const JSCFunctionEnum_JS_CFUNC_iterator_next: JSCFunctionEnum = 12; -pub type JSCFunctionEnum = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Copy, Clone)] -pub union JSCFunctionType { - pub generic: JSCFunction, - pub generic_magic: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - this_val: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - magic: ::std::os::raw::c_int, - ) -> JSValue, - >, - pub constructor: JSCFunction, - pub constructor_magic: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - new_target: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - magic: ::std::os::raw::c_int, - ) -> JSValue, - >, - pub constructor_or_func: JSCFunction, - pub f_f: ::std::option::Option f64>, - pub f_f_f: ::std::option::Option f64>, - pub getter: ::std::option::Option< - unsafe extern "C" fn(ctx: *mut JSContext, this_val: JSValue) -> JSValue, - >, - pub setter: ::std::option::Option< - unsafe extern "C" fn(ctx: *mut JSContext, this_val: JSValue, val: JSValue) -> JSValue, - >, - pub getter_magic: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - this_val: JSValue, - magic: ::std::os::raw::c_int, - ) -> JSValue, - >, - pub setter_magic: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - this_val: JSValue, - val: JSValue, - magic: ::std::os::raw::c_int, - ) -> JSValue, - >, - pub iterator_next: ::std::option::Option< - unsafe extern "C" fn( - ctx: *mut JSContext, - this_val: JSValue, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - pdone: *mut ::std::os::raw::c_int, - magic: ::std::os::raw::c_int, - ) -> JSValue, - >, -} -#[test] -fn bindgen_test_layout_JSCFunctionType() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSCFunctionType)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSCFunctionType)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).generic) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(generic) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).generic_magic) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(generic_magic) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).constructor) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(constructor) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).constructor_magic) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(constructor_magic) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).constructor_or_func) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(constructor_or_func) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).f_f) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(f_f) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).f_f_f) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(f_f_f) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).getter) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(getter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).setter) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(setter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).getter_magic) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(getter_magic) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).setter_magic) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(setter_magic) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iterator_next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionType), - "::", - stringify!(iterator_next) - ) - ); -} -extern "C" { - pub fn JS_NewCFunction2( - ctx: *mut JSContext, - func: JSCFunction, - name: *const ::std::os::raw::c_char, - length: ::std::os::raw::c_int, - cproto: JSCFunctionEnum, - magic: ::std::os::raw::c_int, - ) -> JSValue; -} -extern "C" { - pub fn JS_NewCFunctionData( - ctx: *mut JSContext, - func: JSCFunctionData, - length: ::std::os::raw::c_int, - magic: ::std::os::raw::c_int, - data_len: ::std::os::raw::c_int, - data: *mut JSValue, - ) -> JSValue; -} -extern "C" { - pub fn JS_SetConstructor(ctx: *mut JSContext, func_obj: JSValue, proto: JSValue); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct JSCFunctionListEntry { - pub name: *const ::std::os::raw::c_char, - pub prop_flags: u8, - pub def_type: u8, - pub magic: i16, - pub u: JSCFunctionListEntry__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union JSCFunctionListEntry__bindgen_ty_1 { - pub func: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1, - pub getset: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2, - pub alias: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3, - pub prop_list: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4, - pub str_: *const ::std::os::raw::c_char, - pub i32_: i32, - pub i64_: i64, - pub f64_: f64, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1 { - pub length: u8, - pub cproto: u8, - pub cfunc: JSCFunctionType, -} -#[test] -fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cproto) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(cproto) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cfunc) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(cfunc) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2 { - pub get: JSCFunctionType, - pub set: JSCFunctionType, -} -#[test] -fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).get) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(get) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(set) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3 { - pub name: *const ::std::os::raw::c_char, - pub base: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).base) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(base) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4 { - pub tab: *const JSCFunctionListEntry, - pub len: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4), - "::", - stringify!(tab) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4), - "::", - stringify!(len) - ) - ); -} -#[test] -fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(JSCFunctionListEntry__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).func) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1), - "::", - stringify!(func) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).getset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1), - "::", - stringify!(getset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alias) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1), - "::", - stringify!(alias) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prop_list) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1), - "::", - stringify!(prop_list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).str_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1), - "::", - stringify!(str_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).i32_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1), - "::", - stringify!(i32_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).i64_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1), - "::", - stringify!(i64_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).f64_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry__bindgen_ty_1), - "::", - stringify!(f64_) - ) - ); -} -#[test] -fn bindgen_test_layout_JSCFunctionListEntry() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JSCFunctionListEntry)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSCFunctionListEntry)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prop_flags) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry), - "::", - stringify!(prop_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).def_type) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry), - "::", - stringify!(def_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry), - "::", - stringify!(magic) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSCFunctionListEntry), - "::", - stringify!(u) - ) - ); -} -extern "C" { - pub fn JS_SetPropertyFunctionList( - ctx: *mut JSContext, - obj: JSValue, - tab: *const JSCFunctionListEntry, - len: ::std::os::raw::c_int, - ); -} -pub type JSModuleInitFunc = ::std::option::Option< - unsafe extern "C" fn(ctx: *mut JSContext, m: *mut JSModuleDef) -> ::std::os::raw::c_int, ->; -extern "C" { - pub fn JS_NewCModule( - ctx: *mut JSContext, - name_str: *const ::std::os::raw::c_char, - func: JSModuleInitFunc, - ) -> *mut JSModuleDef; -} -extern "C" { - pub fn JS_AddModuleExport( - ctx: *mut JSContext, - m: *mut JSModuleDef, - name_str: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_AddModuleExportList( - ctx: *mut JSContext, - m: *mut JSModuleDef, - tab: *const JSCFunctionListEntry, - len: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_SetModuleExport( - ctx: *mut JSContext, - m: *mut JSModuleDef, - export_name: *const ::std::os::raw::c_char, - val: JSValue, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_SetModuleExportList( - ctx: *mut JSContext, - m: *mut JSModuleDef, - tab: *const JSCFunctionListEntry, - len: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; -pub const JS_ATOM_null: _bindgen_ty_2 = 1; -pub const JS_ATOM_false: _bindgen_ty_2 = 2; -pub const JS_ATOM_true: _bindgen_ty_2 = 3; -pub const JS_ATOM_if: _bindgen_ty_2 = 4; -pub const JS_ATOM_else: _bindgen_ty_2 = 5; -pub const JS_ATOM_return: _bindgen_ty_2 = 6; -pub const JS_ATOM_var: _bindgen_ty_2 = 7; -pub const JS_ATOM_this: _bindgen_ty_2 = 8; -pub const JS_ATOM_delete: _bindgen_ty_2 = 9; -pub const JS_ATOM_void: _bindgen_ty_2 = 10; -pub const JS_ATOM_typeof: _bindgen_ty_2 = 11; -pub const JS_ATOM_new: _bindgen_ty_2 = 12; -pub const JS_ATOM_in: _bindgen_ty_2 = 13; -pub const JS_ATOM_instanceof: _bindgen_ty_2 = 14; -pub const JS_ATOM_do: _bindgen_ty_2 = 15; -pub const JS_ATOM_while: _bindgen_ty_2 = 16; -pub const JS_ATOM_for: _bindgen_ty_2 = 17; -pub const JS_ATOM_break: _bindgen_ty_2 = 18; -pub const JS_ATOM_continue: _bindgen_ty_2 = 19; -pub const JS_ATOM_switch: _bindgen_ty_2 = 20; -pub const JS_ATOM_case: _bindgen_ty_2 = 21; -pub const JS_ATOM_default: _bindgen_ty_2 = 22; -pub const JS_ATOM_throw: _bindgen_ty_2 = 23; -pub const JS_ATOM_try: _bindgen_ty_2 = 24; -pub const JS_ATOM_catch: _bindgen_ty_2 = 25; -pub const JS_ATOM_finally: _bindgen_ty_2 = 26; -pub const JS_ATOM_function: _bindgen_ty_2 = 27; -pub const JS_ATOM_debugger: _bindgen_ty_2 = 28; -pub const JS_ATOM_with: _bindgen_ty_2 = 29; -pub const JS_ATOM_class: _bindgen_ty_2 = 30; -pub const JS_ATOM_const: _bindgen_ty_2 = 31; -pub const JS_ATOM_enum: _bindgen_ty_2 = 32; -pub const JS_ATOM_export: _bindgen_ty_2 = 33; -pub const JS_ATOM_extends: _bindgen_ty_2 = 34; -pub const JS_ATOM_import: _bindgen_ty_2 = 35; -pub const JS_ATOM_super: _bindgen_ty_2 = 36; -pub const JS_ATOM_implements: _bindgen_ty_2 = 37; -pub const JS_ATOM_interface: _bindgen_ty_2 = 38; -pub const JS_ATOM_let: _bindgen_ty_2 = 39; -pub const JS_ATOM_package: _bindgen_ty_2 = 40; -pub const JS_ATOM_private: _bindgen_ty_2 = 41; -pub const JS_ATOM_protected: _bindgen_ty_2 = 42; -pub const JS_ATOM_public: _bindgen_ty_2 = 43; -pub const JS_ATOM_static: _bindgen_ty_2 = 44; -pub const JS_ATOM_yield: _bindgen_ty_2 = 45; -pub const JS_ATOM_await: _bindgen_ty_2 = 46; -pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; -pub type _bindgen_ty_2 = ::std::os::raw::c_uint; diff --git a/sys/src/bindings/i686-unknown-linux-gnu.rs b/sys/src/bindings/i686-unknown-linux-gnu.rs index 8f667f39..0e72eb0f 100644 --- a/sys/src/bindings/i686-unknown-linux-gnu.rs +++ b/sys/src/bindings/i686-unknown-linux-gnu.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.69.5 */ pub const JS_PROP_CONFIGURABLE: u32 = 1; pub const JS_PROP_WRITABLE: u32 = 2; @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -82,54 +85,22 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; -pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; -pub const JS_TAG_STRING: _bindgen_ty_1 = -7; -pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; -pub const JS_TAG_FUNCTION_BYTECODE: _bindgen_ty_1 = -2; -pub const JS_TAG_OBJECT: _bindgen_ty_1 = -1; -pub const JS_TAG_INT: _bindgen_ty_1 = 0; -pub const JS_TAG_BOOL: _bindgen_ty_1 = 1; -pub const JS_TAG_NULL: _bindgen_ty_1 = 2; -pub const JS_TAG_UNDEFINED: _bindgen_ty_1 = 3; -pub const JS_TAG_UNINITIALIZED: _bindgen_ty_1 = 4; -pub const JS_TAG_CATCH_OFFSET: _bindgen_ty_1 = 5; -pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; -pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; -pub type _bindgen_ty_1 = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSRefCountHeader), - "::", - stringify!(ref_count) - ) - ); -} +pub const JS_TAG_FIRST: _bindgen_ty_3 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_3 = -9; +pub const JS_TAG_SYMBOL: _bindgen_ty_3 = -8; +pub const JS_TAG_STRING: _bindgen_ty_3 = -7; +pub const JS_TAG_MODULE: _bindgen_ty_3 = -3; +pub const JS_TAG_FUNCTION_BYTECODE: _bindgen_ty_3 = -2; +pub const JS_TAG_OBJECT: _bindgen_ty_3 = -1; +pub const JS_TAG_INT: _bindgen_ty_3 = 0; +pub const JS_TAG_BOOL: _bindgen_ty_3 = 1; +pub const JS_TAG_NULL: _bindgen_ty_3 = 2; +pub const JS_TAG_UNDEFINED: _bindgen_ty_3 = 3; +pub const JS_TAG_UNINITIALIZED: _bindgen_ty_3 = 4; +pub const JS_TAG_CATCH_OFFSET: _bindgen_ty_3 = 5; +pub const JS_TAG_EXCEPTION: _bindgen_ty_3 = 6; +pub const JS_TAG_FLOAT64: _bindgen_ty_3 = 7; +pub type _bindgen_ty_3 = ::std::os::raw::c_int; pub type JSValue = u64; pub type JSCFunction = ::std::option::Option< unsafe extern "C" fn( @@ -160,79 +131,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -246,7 +164,7 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 16usize, + 20usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( @@ -255,8 +173,18 @@ fn bindgen_test_layout_JSMallocFunctions() { concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -266,7 +194,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -276,7 +204,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -286,7 +214,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 12usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -295,6 +223,9 @@ fn bindgen_test_layout_JSMallocFunctions() { ) ); } +pub type JSRuntimeFinalizer = ::std::option::Option< + unsafe extern "C" fn(rt: *mut JSRuntime, arg: *mut ::std::os::raw::c_void), +>; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSGCObjectHeader { @@ -309,6 +240,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -333,6 +270,13 @@ extern "C" { extern "C" { pub fn JS_SetRuntimeOpaque(rt: *mut JSRuntime, opaque: *mut ::std::os::raw::c_void); } +extern "C" { + pub fn JS_AddRuntimeFinalizer( + rt: *mut JSRuntime, + finalizer: JSRuntimeFinalizer, + arg: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} pub type JS_MarkFunc = ::std::option::Option; extern "C" { @@ -383,9 +327,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -411,16 +352,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -430,6 +386,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -452,6 +415,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -516,8 +486,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -531,7 +499,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -739,29 +707,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -771,7 +719,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -781,7 +729,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -791,7 +739,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -801,7 +749,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -811,7 +759,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -1199,7 +1147,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1214,6 +1162,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1226,6 +1177,9 @@ extern "C" { extern "C" { pub fn JS_GetException(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_HasException(ctx: *mut JSContext) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } @@ -1235,6 +1189,13 @@ extern "C" { extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1274,10 +1235,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); +} +extern "C" { + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); +} +extern "C" { + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1302,6 +1269,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1316,9 +1290,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1378,13 +1349,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1394,16 +1365,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1461,6 +1427,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1478,6 +1451,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1610,20 +1586,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1660,6 +1630,12 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; +} extern "C" { pub fn JS_GetTypedArrayBuffer( ctx: *mut JSContext, @@ -1669,6 +1645,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1761,6 +1753,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1857,6 +1856,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1871,8 +1911,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1883,6 +1922,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2569,233 +2617,229 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; -pub const JS_ATOM_null: _bindgen_ty_2 = 1; -pub const JS_ATOM_false: _bindgen_ty_2 = 2; -pub const JS_ATOM_true: _bindgen_ty_2 = 3; -pub const JS_ATOM_if: _bindgen_ty_2 = 4; -pub const JS_ATOM_else: _bindgen_ty_2 = 5; -pub const JS_ATOM_return: _bindgen_ty_2 = 6; -pub const JS_ATOM_var: _bindgen_ty_2 = 7; -pub const JS_ATOM_this: _bindgen_ty_2 = 8; -pub const JS_ATOM_delete: _bindgen_ty_2 = 9; -pub const JS_ATOM_void: _bindgen_ty_2 = 10; -pub const JS_ATOM_typeof: _bindgen_ty_2 = 11; -pub const JS_ATOM_new: _bindgen_ty_2 = 12; -pub const JS_ATOM_in: _bindgen_ty_2 = 13; -pub const JS_ATOM_instanceof: _bindgen_ty_2 = 14; -pub const JS_ATOM_do: _bindgen_ty_2 = 15; -pub const JS_ATOM_while: _bindgen_ty_2 = 16; -pub const JS_ATOM_for: _bindgen_ty_2 = 17; -pub const JS_ATOM_break: _bindgen_ty_2 = 18; -pub const JS_ATOM_continue: _bindgen_ty_2 = 19; -pub const JS_ATOM_switch: _bindgen_ty_2 = 20; -pub const JS_ATOM_case: _bindgen_ty_2 = 21; -pub const JS_ATOM_default: _bindgen_ty_2 = 22; -pub const JS_ATOM_throw: _bindgen_ty_2 = 23; -pub const JS_ATOM_try: _bindgen_ty_2 = 24; -pub const JS_ATOM_catch: _bindgen_ty_2 = 25; -pub const JS_ATOM_finally: _bindgen_ty_2 = 26; -pub const JS_ATOM_function: _bindgen_ty_2 = 27; -pub const JS_ATOM_debugger: _bindgen_ty_2 = 28; -pub const JS_ATOM_with: _bindgen_ty_2 = 29; -pub const JS_ATOM_class: _bindgen_ty_2 = 30; -pub const JS_ATOM_const: _bindgen_ty_2 = 31; -pub const JS_ATOM_enum: _bindgen_ty_2 = 32; -pub const JS_ATOM_export: _bindgen_ty_2 = 33; -pub const JS_ATOM_extends: _bindgen_ty_2 = 34; -pub const JS_ATOM_import: _bindgen_ty_2 = 35; -pub const JS_ATOM_super: _bindgen_ty_2 = 36; -pub const JS_ATOM_implements: _bindgen_ty_2 = 37; -pub const JS_ATOM_interface: _bindgen_ty_2 = 38; -pub const JS_ATOM_let: _bindgen_ty_2 = 39; -pub const JS_ATOM_package: _bindgen_ty_2 = 40; -pub const JS_ATOM_private: _bindgen_ty_2 = 41; -pub const JS_ATOM_protected: _bindgen_ty_2 = 42; -pub const JS_ATOM_public: _bindgen_ty_2 = 43; -pub const JS_ATOM_static: _bindgen_ty_2 = 44; -pub const JS_ATOM_yield: _bindgen_ty_2 = 45; -pub const JS_ATOM_await: _bindgen_ty_2 = 46; -pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; -pub type _bindgen_ty_2 = ::std::os::raw::c_uint; +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} +pub const __JS_ATOM_NULL: _bindgen_ty_4 = 0; +pub const JS_ATOM_null: _bindgen_ty_4 = 1; +pub const JS_ATOM_false: _bindgen_ty_4 = 2; +pub const JS_ATOM_true: _bindgen_ty_4 = 3; +pub const JS_ATOM_if: _bindgen_ty_4 = 4; +pub const JS_ATOM_else: _bindgen_ty_4 = 5; +pub const JS_ATOM_return: _bindgen_ty_4 = 6; +pub const JS_ATOM_var: _bindgen_ty_4 = 7; +pub const JS_ATOM_this: _bindgen_ty_4 = 8; +pub const JS_ATOM_delete: _bindgen_ty_4 = 9; +pub const JS_ATOM_void: _bindgen_ty_4 = 10; +pub const JS_ATOM_typeof: _bindgen_ty_4 = 11; +pub const JS_ATOM_new: _bindgen_ty_4 = 12; +pub const JS_ATOM_in: _bindgen_ty_4 = 13; +pub const JS_ATOM_instanceof: _bindgen_ty_4 = 14; +pub const JS_ATOM_do: _bindgen_ty_4 = 15; +pub const JS_ATOM_while: _bindgen_ty_4 = 16; +pub const JS_ATOM_for: _bindgen_ty_4 = 17; +pub const JS_ATOM_break: _bindgen_ty_4 = 18; +pub const JS_ATOM_continue: _bindgen_ty_4 = 19; +pub const JS_ATOM_switch: _bindgen_ty_4 = 20; +pub const JS_ATOM_case: _bindgen_ty_4 = 21; +pub const JS_ATOM_default: _bindgen_ty_4 = 22; +pub const JS_ATOM_throw: _bindgen_ty_4 = 23; +pub const JS_ATOM_try: _bindgen_ty_4 = 24; +pub const JS_ATOM_catch: _bindgen_ty_4 = 25; +pub const JS_ATOM_finally: _bindgen_ty_4 = 26; +pub const JS_ATOM_function: _bindgen_ty_4 = 27; +pub const JS_ATOM_debugger: _bindgen_ty_4 = 28; +pub const JS_ATOM_with: _bindgen_ty_4 = 29; +pub const JS_ATOM_class: _bindgen_ty_4 = 30; +pub const JS_ATOM_const: _bindgen_ty_4 = 31; +pub const JS_ATOM_enum: _bindgen_ty_4 = 32; +pub const JS_ATOM_export: _bindgen_ty_4 = 33; +pub const JS_ATOM_extends: _bindgen_ty_4 = 34; +pub const JS_ATOM_import: _bindgen_ty_4 = 35; +pub const JS_ATOM_super: _bindgen_ty_4 = 36; +pub const JS_ATOM_implements: _bindgen_ty_4 = 37; +pub const JS_ATOM_interface: _bindgen_ty_4 = 38; +pub const JS_ATOM_let: _bindgen_ty_4 = 39; +pub const JS_ATOM_package: _bindgen_ty_4 = 40; +pub const JS_ATOM_private: _bindgen_ty_4 = 41; +pub const JS_ATOM_protected: _bindgen_ty_4 = 42; +pub const JS_ATOM_public: _bindgen_ty_4 = 43; +pub const JS_ATOM_static: _bindgen_ty_4 = 44; +pub const JS_ATOM_yield: _bindgen_ty_4 = 45; +pub const JS_ATOM_await: _bindgen_ty_4 = 46; +pub const JS_ATOM_empty_string: _bindgen_ty_4 = 47; +pub const JS_ATOM_keys: _bindgen_ty_4 = 48; +pub const JS_ATOM_size: _bindgen_ty_4 = 49; +pub const JS_ATOM_length: _bindgen_ty_4 = 50; +pub const JS_ATOM_message: _bindgen_ty_4 = 51; +pub const JS_ATOM_cause: _bindgen_ty_4 = 52; +pub const JS_ATOM_errors: _bindgen_ty_4 = 53; +pub const JS_ATOM_stack: _bindgen_ty_4 = 54; +pub const JS_ATOM_name: _bindgen_ty_4 = 55; +pub const JS_ATOM_toString: _bindgen_ty_4 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_4 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_4 = 58; +pub const JS_ATOM_eval: _bindgen_ty_4 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_4 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_4 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_4 = 62; +pub const JS_ATOM_writable: _bindgen_ty_4 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_4 = 64; +pub const JS_ATOM_value: _bindgen_ty_4 = 65; +pub const JS_ATOM_get: _bindgen_ty_4 = 66; +pub const JS_ATOM_set: _bindgen_ty_4 = 67; +pub const JS_ATOM_of: _bindgen_ty_4 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_4 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_4 = 70; +pub const JS_ATOM_number: _bindgen_ty_4 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_4 = 72; +pub const JS_ATOM_string: _bindgen_ty_4 = 73; +pub const JS_ATOM_object: _bindgen_ty_4 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_4 = 75; +pub const JS_ATOM_integer: _bindgen_ty_4 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_4 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_4 = 78; +pub const JS_ATOM_callee: _bindgen_ty_4 = 79; +pub const JS_ATOM_caller: _bindgen_ty_4 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_4 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_4 = 82; +pub const JS_ATOM__var_: _bindgen_ty_4 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_4 = 84; +pub const JS_ATOM__with_: _bindgen_ty_4 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_4 = 86; +pub const JS_ATOM_target: _bindgen_ty_4 = 87; +pub const JS_ATOM_index: _bindgen_ty_4 = 88; +pub const JS_ATOM_input: _bindgen_ty_4 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_4 = 90; +pub const JS_ATOM_apply: _bindgen_ty_4 = 91; +pub const JS_ATOM_join: _bindgen_ty_4 = 92; +pub const JS_ATOM_concat: _bindgen_ty_4 = 93; +pub const JS_ATOM_split: _bindgen_ty_4 = 94; +pub const JS_ATOM_construct: _bindgen_ty_4 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_4 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_4 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_4 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_4 = 99; +pub const JS_ATOM_has: _bindgen_ty_4 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_4 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_4 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_4 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_4 = 104; +pub const JS_ATOM_add: _bindgen_ty_4 = 105; +pub const JS_ATOM_done: _bindgen_ty_4 = 106; +pub const JS_ATOM_next: _bindgen_ty_4 = 107; +pub const JS_ATOM_values: _bindgen_ty_4 = 108; +pub const JS_ATOM_source: _bindgen_ty_4 = 109; +pub const JS_ATOM_flags: _bindgen_ty_4 = 110; +pub const JS_ATOM_global: _bindgen_ty_4 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_4 = 112; +pub const JS_ATOM_raw: _bindgen_ty_4 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_4 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_4 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_4 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_4 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_4 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_4 = 119; +pub const JS_ATOM_brand: _bindgen_ty_4 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_4 = 121; +pub const JS_ATOM_as: _bindgen_ty_4 = 122; +pub const JS_ATOM_from: _bindgen_ty_4 = 123; +pub const JS_ATOM_meta: _bindgen_ty_4 = 124; +pub const JS_ATOM__default_: _bindgen_ty_4 = 125; +pub const JS_ATOM__star_: _bindgen_ty_4 = 126; +pub const JS_ATOM_Module: _bindgen_ty_4 = 127; +pub const JS_ATOM_then: _bindgen_ty_4 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_4 = 129; +pub const JS_ATOM_reject: _bindgen_ty_4 = 130; +pub const JS_ATOM_promise: _bindgen_ty_4 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_4 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_4 = 133; +pub const JS_ATOM_async: _bindgen_ty_4 = 134; +pub const JS_ATOM_exec: _bindgen_ty_4 = 135; +pub const JS_ATOM_groups: _bindgen_ty_4 = 136; +pub const JS_ATOM_indices: _bindgen_ty_4 = 137; +pub const JS_ATOM_status: _bindgen_ty_4 = 138; +pub const JS_ATOM_reason: _bindgen_ty_4 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_4 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_4 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_4 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_4 = 143; +pub const JS_ATOM_ok: _bindgen_ty_4 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_4 = 145; +pub const JS_ATOM_Object: _bindgen_ty_4 = 146; +pub const JS_ATOM_Array: _bindgen_ty_4 = 147; +pub const JS_ATOM_Error: _bindgen_ty_4 = 148; +pub const JS_ATOM_Number: _bindgen_ty_4 = 149; +pub const JS_ATOM_String: _bindgen_ty_4 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_4 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_4 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_4 = 153; +pub const JS_ATOM_Math: _bindgen_ty_4 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_4 = 155; +pub const JS_ATOM_Date: _bindgen_ty_4 = 156; +pub const JS_ATOM_Function: _bindgen_ty_4 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_4 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_4 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_4 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_4 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_4 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_4 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_4 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_4 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_4 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_4 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_4 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_4 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_4 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_4 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_4 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_4 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_4 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_4 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_4 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_4 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_4 = 178; +pub const JS_ATOM_Map: _bindgen_ty_4 = 179; +pub const JS_ATOM_Set: _bindgen_ty_4 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_4 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_4 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_4 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_4 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_4 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_4 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_4 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_4 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_4 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_4 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_4 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_4 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_4 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_4 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_4 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_4 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_4 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_4 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_4 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_4 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_4 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_4 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_4 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_4 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_4 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_4 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_4 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_4 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_4 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_4 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_4 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_4 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_4 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_4 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_4 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_4 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_4 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_4 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_4 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_4 = 220; +pub const JS_ATOM_END: _bindgen_ty_4 = 221; +pub type _bindgen_ty_4 = ::std::os::raw::c_uint; \ No newline at end of file diff --git a/sys/src/bindings/wasm32-wasip1.rs b/sys/src/bindings/wasm32-wasip1.rs index f2dae7d1..fa0f0103 100644 --- a/sys/src/bindings/wasm32-wasip1.rs +++ b/sys/src/bindings/wasm32-wasip1.rs @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -82,10 +85,8 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; pub const JS_TAG_STRING: _bindgen_ty_1 = -7; pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; @@ -101,36 +102,98 @@ pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, +#[derive(Copy, Clone)] +pub union JSValueUnion { + pub int32: i32, + pub float64: f64, + pub ptr: *mut ::std::os::raw::c_void, } #[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_JSValueUnion() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(JSValueUnion)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSValueUnion)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).int32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSValueUnion), + "::", + stringify!(int32) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).float64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSValueUnion), + "::", + stringify!(float64) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(JSRefCountHeader), + stringify!(JSValueUnion), + "::", + stringify!(ptr) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct JSValue { + pub u: JSValueUnion, + pub tag: i64, +} +#[test] +fn bindgen_test_layout_JSValue() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSValue)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSValue)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSValue), + "::", + stringify!(u) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSValue), "::", - stringify!(ref_count) + stringify!(tag) ) ); } -pub type JSValue = u64; pub type JSCFunction = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -160,79 +223,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -246,17 +256,27 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 16usize, + 40usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -266,7 +286,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 4usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -276,7 +296,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 8usize, + 24usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -286,7 +306,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 12usize, + 32usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -309,6 +329,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -383,9 +409,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -411,16 +434,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -430,6 +468,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -452,6 +497,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -516,8 +568,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -531,7 +581,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -739,29 +789,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -771,7 +801,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -781,7 +811,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -791,7 +821,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -801,7 +831,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -811,7 +841,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -899,7 +929,7 @@ fn bindgen_test_layout_JSPropertyEnum() { ); } #[repr(C)] -#[derive(Debug, Copy, Clone)] +#[derive(Copy, Clone)] pub struct JSPropertyDescriptor { pub flags: ::std::os::raw::c_int, pub value: JSValue, @@ -912,7 +942,7 @@ fn bindgen_test_layout_JSPropertyDescriptor() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 56usize, concat!("Size of: ", stringify!(JSPropertyDescriptor)) ); assert_eq!( @@ -942,7 +972,7 @@ fn bindgen_test_layout_JSPropertyDescriptor() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).getter) as usize - ptr as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(JSPropertyDescriptor), @@ -952,7 +982,7 @@ fn bindgen_test_layout_JSPropertyDescriptor() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).setter) as usize - ptr as usize }, - 24usize, + 40usize, concat!( "Offset of field: ", stringify!(JSPropertyDescriptor), @@ -1030,12 +1060,12 @@ fn bindgen_test_layout_JSClassExoticMethods() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 28usize, + 56usize, concat!("Size of: ", stringify!(JSClassExoticMethods)) ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!("Alignment of ", stringify!(JSClassExoticMethods)) ); assert_eq!( @@ -1050,7 +1080,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).get_own_property_names) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1060,7 +1090,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).delete_property) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1070,7 +1100,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).define_own_property) as usize - ptr as usize }, - 12usize, + 24usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1080,7 +1110,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).has_property) as usize - ptr as usize }, - 16usize, + 32usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1090,7 +1120,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).get_property) as usize - ptr as usize }, - 20usize, + 40usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1100,7 +1130,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).set_property) as usize - ptr as usize }, - 24usize, + 48usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1139,12 +1169,12 @@ fn bindgen_test_layout_JSClassDef() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 20usize, + 40usize, concat!("Size of: ", stringify!(JSClassDef)) ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!("Alignment of ", stringify!(JSClassDef)) ); assert_eq!( @@ -1159,7 +1189,7 @@ fn bindgen_test_layout_JSClassDef() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).finalizer) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSClassDef), @@ -1169,7 +1199,7 @@ fn bindgen_test_layout_JSClassDef() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gc_mark) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSClassDef), @@ -1179,7 +1209,7 @@ fn bindgen_test_layout_JSClassDef() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).call) as usize - ptr as usize }, - 12usize, + 24usize, concat!( "Offset of field: ", stringify!(JSClassDef), @@ -1189,7 +1219,7 @@ fn bindgen_test_layout_JSClassDef() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exotic) as usize - ptr as usize }, - 16usize, + 32usize, concat!( "Offset of field: ", stringify!(JSClassDef), @@ -1199,7 +1229,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1214,6 +1244,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1232,15 +1265,19 @@ extern "C" { extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } -extern "C" { - pub fn JS_SetUncatchableError(ctx: *mut JSContext, val: JSValue, flag: ::std::os::raw::c_int); -} extern "C" { pub fn JS_ResetUncatchableError(ctx: *mut JSContext); } extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1280,23 +1317,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); } extern "C" { - pub fn JS_StrictEq(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; } extern "C" { - pub fn JS_SameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_SameValueZero( - ctx: *mut JSContext, - op1: JSValue, - op2: JSValue, - ) -> ::std::os::raw::c_int; + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1321,6 +1351,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1335,9 +1372,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1397,13 +1431,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1413,16 +1447,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1480,6 +1509,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1497,6 +1533,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1629,20 +1668,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1679,25 +1712,11 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT8C: JSTypedArrayEnum = 0; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_INT8: JSTypedArrayEnum = 1; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT8: JSTypedArrayEnum = 2; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_INT16: JSTypedArrayEnum = 3; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT16: JSTypedArrayEnum = 4; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_INT32: JSTypedArrayEnum = 5; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT32: JSTypedArrayEnum = 6; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_BIG_INT64: JSTypedArrayEnum = 7; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_BIG_UINT64: JSTypedArrayEnum = 8; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_FLOAT32: JSTypedArrayEnum = 9; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_FLOAT64: JSTypedArrayEnum = 10; -pub type JSTypedArrayEnum = ::std::os::raw::c_uint; -extern "C" { - pub fn JS_NewTypedArray( - ctx: *mut JSContext, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - array_type: JSTypedArrayEnum, - ) -> JSValue; +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } extern "C" { pub fn JS_GetTypedArrayBuffer( @@ -1708,6 +1727,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1732,12 +1767,12 @@ fn bindgen_test_layout_JSSharedArrayBufferFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 16usize, + 32usize, concat!("Size of: ", stringify!(JSSharedArrayBufferFunctions)) ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!("Alignment of ", stringify!(JSSharedArrayBufferFunctions)) ); assert_eq!( @@ -1752,7 +1787,7 @@ fn bindgen_test_layout_JSSharedArrayBufferFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sab_free) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSSharedArrayBufferFunctions), @@ -1762,7 +1797,7 @@ fn bindgen_test_layout_JSSharedArrayBufferFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sab_dup) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSSharedArrayBufferFunctions), @@ -1772,7 +1807,7 @@ fn bindgen_test_layout_JSSharedArrayBufferFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sab_opaque) as usize - ptr as usize }, - 12usize, + 24usize, concat!( "Offset of field: ", stringify!(JSSharedArrayBufferFunctions), @@ -1800,6 +1835,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1896,6 +1938,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1910,8 +1993,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1922,6 +2004,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2019,12 +2110,12 @@ fn bindgen_test_layout_JSCFunctionType() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 4usize, + 8usize, concat!("Size of: ", stringify!(JSCFunctionType)) ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!("Alignment of ", stringify!(JSCFunctionType)) ); assert_eq!( @@ -2206,7 +2297,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 8usize, + 16usize, concat!( "Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1) @@ -2214,7 +2305,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!( "Alignment of ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1) @@ -2242,7 +2333,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cfunc) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1), @@ -2264,7 +2355,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 8usize, + 16usize, concat!( "Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2) @@ -2272,7 +2363,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!( "Alignment of ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2) @@ -2290,7 +2381,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).set) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2), @@ -2312,7 +2403,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 8usize, + 16usize, concat!( "Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3) @@ -2320,7 +2411,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3() { ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!( "Alignment of ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3) @@ -2338,7 +2429,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).base) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3), @@ -2360,7 +2451,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 8usize, + 16usize, concat!( "Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4) @@ -2368,7 +2459,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4() { ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!( "Alignment of ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4) @@ -2386,7 +2477,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4), @@ -2402,7 +2493,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 8usize, + 16usize, concat!("Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1)) ); assert_eq!( @@ -2500,7 +2591,7 @@ fn bindgen_test_layout_JSCFunctionListEntry() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 16usize, + 32usize, concat!("Size of: ", stringify!(JSCFunctionListEntry)) ); assert_eq!( @@ -2520,7 +2611,7 @@ fn bindgen_test_layout_JSCFunctionListEntry() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).prop_flags) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry), @@ -2530,7 +2621,7 @@ fn bindgen_test_layout_JSCFunctionListEntry() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).def_type) as usize - ptr as usize }, - 5usize, + 9usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry), @@ -2540,7 +2631,7 @@ fn bindgen_test_layout_JSCFunctionListEntry() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, - 6usize, + 10usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry), @@ -2550,7 +2641,7 @@ fn bindgen_test_layout_JSCFunctionListEntry() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry), @@ -2608,6 +2699,9 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; pub const JS_ATOM_null: _bindgen_ty_2 = 1; pub const JS_ATOM_false: _bindgen_ty_2 = 2; @@ -2656,185 +2750,178 @@ pub const JS_ATOM_static: _bindgen_ty_2 = 44; pub const JS_ATOM_yield: _bindgen_ty_2 = 45; pub const JS_ATOM_await: _bindgen_ty_2 = 46; pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 119; +pub const JS_ATOM_brand: _bindgen_ty_2 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 121; +pub const JS_ATOM_as: _bindgen_ty_2 = 122; +pub const JS_ATOM_from: _bindgen_ty_2 = 123; +pub const JS_ATOM_meta: _bindgen_ty_2 = 124; +pub const JS_ATOM__default_: _bindgen_ty_2 = 125; +pub const JS_ATOM__star_: _bindgen_ty_2 = 126; +pub const JS_ATOM_Module: _bindgen_ty_2 = 127; +pub const JS_ATOM_then: _bindgen_ty_2 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 129; +pub const JS_ATOM_reject: _bindgen_ty_2 = 130; +pub const JS_ATOM_promise: _bindgen_ty_2 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 133; +pub const JS_ATOM_async: _bindgen_ty_2 = 134; +pub const JS_ATOM_exec: _bindgen_ty_2 = 135; +pub const JS_ATOM_groups: _bindgen_ty_2 = 136; +pub const JS_ATOM_indices: _bindgen_ty_2 = 137; +pub const JS_ATOM_status: _bindgen_ty_2 = 138; +pub const JS_ATOM_reason: _bindgen_ty_2 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 143; +pub const JS_ATOM_ok: _bindgen_ty_2 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 145; +pub const JS_ATOM_Object: _bindgen_ty_2 = 146; +pub const JS_ATOM_Array: _bindgen_ty_2 = 147; +pub const JS_ATOM_Error: _bindgen_ty_2 = 148; +pub const JS_ATOM_Number: _bindgen_ty_2 = 149; +pub const JS_ATOM_String: _bindgen_ty_2 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 153; +pub const JS_ATOM_Math: _bindgen_ty_2 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 155; +pub const JS_ATOM_Date: _bindgen_ty_2 = 156; +pub const JS_ATOM_Function: _bindgen_ty_2 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 178; +pub const JS_ATOM_Map: _bindgen_ty_2 = 179; +pub const JS_ATOM_Set: _bindgen_ty_2 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 220; +pub const JS_ATOM_END: _bindgen_ty_2 = 221; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; diff --git a/sys/src/bindings/wasm32-wasip2.rs b/sys/src/bindings/wasm32-wasip2.rs index f2dae7d1..fa0f0103 100644 --- a/sys/src/bindings/wasm32-wasip2.rs +++ b/sys/src/bindings/wasm32-wasip2.rs @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -82,10 +85,8 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; pub const JS_TAG_STRING: _bindgen_ty_1 = -7; pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; @@ -101,36 +102,98 @@ pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, +#[derive(Copy, Clone)] +pub union JSValueUnion { + pub int32: i32, + pub float64: f64, + pub ptr: *mut ::std::os::raw::c_void, } #[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_JSValueUnion() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(JSValueUnion)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSValueUnion)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).int32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSValueUnion), + "::", + stringify!(int32) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).float64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSValueUnion), + "::", + stringify!(float64) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(JSRefCountHeader), + stringify!(JSValueUnion), + "::", + stringify!(ptr) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct JSValue { + pub u: JSValueUnion, + pub tag: i64, +} +#[test] +fn bindgen_test_layout_JSValue() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSValue)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSValue)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSValue), + "::", + stringify!(u) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSValue), "::", - stringify!(ref_count) + stringify!(tag) ) ); } -pub type JSValue = u64; pub type JSCFunction = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -160,79 +223,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -246,17 +256,27 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 16usize, + 40usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -266,7 +286,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 4usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -276,7 +296,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 8usize, + 24usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -286,7 +306,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 12usize, + 32usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -309,6 +329,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -383,9 +409,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -411,16 +434,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -430,6 +468,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -452,6 +497,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -516,8 +568,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -531,7 +581,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -739,29 +789,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -771,7 +801,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -781,7 +811,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -791,7 +821,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -801,7 +831,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -811,7 +841,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -899,7 +929,7 @@ fn bindgen_test_layout_JSPropertyEnum() { ); } #[repr(C)] -#[derive(Debug, Copy, Clone)] +#[derive(Copy, Clone)] pub struct JSPropertyDescriptor { pub flags: ::std::os::raw::c_int, pub value: JSValue, @@ -912,7 +942,7 @@ fn bindgen_test_layout_JSPropertyDescriptor() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 56usize, concat!("Size of: ", stringify!(JSPropertyDescriptor)) ); assert_eq!( @@ -942,7 +972,7 @@ fn bindgen_test_layout_JSPropertyDescriptor() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).getter) as usize - ptr as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(JSPropertyDescriptor), @@ -952,7 +982,7 @@ fn bindgen_test_layout_JSPropertyDescriptor() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).setter) as usize - ptr as usize }, - 24usize, + 40usize, concat!( "Offset of field: ", stringify!(JSPropertyDescriptor), @@ -1030,12 +1060,12 @@ fn bindgen_test_layout_JSClassExoticMethods() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 28usize, + 56usize, concat!("Size of: ", stringify!(JSClassExoticMethods)) ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!("Alignment of ", stringify!(JSClassExoticMethods)) ); assert_eq!( @@ -1050,7 +1080,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).get_own_property_names) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1060,7 +1090,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).delete_property) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1070,7 +1100,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).define_own_property) as usize - ptr as usize }, - 12usize, + 24usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1080,7 +1110,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).has_property) as usize - ptr as usize }, - 16usize, + 32usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1090,7 +1120,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).get_property) as usize - ptr as usize }, - 20usize, + 40usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1100,7 +1130,7 @@ fn bindgen_test_layout_JSClassExoticMethods() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).set_property) as usize - ptr as usize }, - 24usize, + 48usize, concat!( "Offset of field: ", stringify!(JSClassExoticMethods), @@ -1139,12 +1169,12 @@ fn bindgen_test_layout_JSClassDef() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 20usize, + 40usize, concat!("Size of: ", stringify!(JSClassDef)) ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!("Alignment of ", stringify!(JSClassDef)) ); assert_eq!( @@ -1159,7 +1189,7 @@ fn bindgen_test_layout_JSClassDef() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).finalizer) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSClassDef), @@ -1169,7 +1199,7 @@ fn bindgen_test_layout_JSClassDef() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gc_mark) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSClassDef), @@ -1179,7 +1209,7 @@ fn bindgen_test_layout_JSClassDef() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).call) as usize - ptr as usize }, - 12usize, + 24usize, concat!( "Offset of field: ", stringify!(JSClassDef), @@ -1189,7 +1219,7 @@ fn bindgen_test_layout_JSClassDef() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exotic) as usize - ptr as usize }, - 16usize, + 32usize, concat!( "Offset of field: ", stringify!(JSClassDef), @@ -1199,7 +1229,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1214,6 +1244,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1232,15 +1265,19 @@ extern "C" { extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } -extern "C" { - pub fn JS_SetUncatchableError(ctx: *mut JSContext, val: JSValue, flag: ::std::os::raw::c_int); -} extern "C" { pub fn JS_ResetUncatchableError(ctx: *mut JSContext); } extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1280,23 +1317,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); } extern "C" { - pub fn JS_StrictEq(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; } extern "C" { - pub fn JS_SameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn JS_SameValueZero( - ctx: *mut JSContext, - op1: JSValue, - op2: JSValue, - ) -> ::std::os::raw::c_int; + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1321,6 +1351,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1335,9 +1372,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1397,13 +1431,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1413,16 +1447,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1480,6 +1509,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1497,6 +1533,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1629,20 +1668,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1679,25 +1712,11 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT8C: JSTypedArrayEnum = 0; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_INT8: JSTypedArrayEnum = 1; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT8: JSTypedArrayEnum = 2; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_INT16: JSTypedArrayEnum = 3; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT16: JSTypedArrayEnum = 4; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_INT32: JSTypedArrayEnum = 5; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT32: JSTypedArrayEnum = 6; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_BIG_INT64: JSTypedArrayEnum = 7; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_BIG_UINT64: JSTypedArrayEnum = 8; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_FLOAT32: JSTypedArrayEnum = 9; -pub const JSTypedArrayEnum_JS_TYPED_ARRAY_FLOAT64: JSTypedArrayEnum = 10; -pub type JSTypedArrayEnum = ::std::os::raw::c_uint; -extern "C" { - pub fn JS_NewTypedArray( - ctx: *mut JSContext, - argc: ::std::os::raw::c_int, - argv: *mut JSValue, - array_type: JSTypedArrayEnum, - ) -> JSValue; +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } extern "C" { pub fn JS_GetTypedArrayBuffer( @@ -1708,6 +1727,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1732,12 +1767,12 @@ fn bindgen_test_layout_JSSharedArrayBufferFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 16usize, + 32usize, concat!("Size of: ", stringify!(JSSharedArrayBufferFunctions)) ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!("Alignment of ", stringify!(JSSharedArrayBufferFunctions)) ); assert_eq!( @@ -1752,7 +1787,7 @@ fn bindgen_test_layout_JSSharedArrayBufferFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sab_free) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSSharedArrayBufferFunctions), @@ -1762,7 +1797,7 @@ fn bindgen_test_layout_JSSharedArrayBufferFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sab_dup) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSSharedArrayBufferFunctions), @@ -1772,7 +1807,7 @@ fn bindgen_test_layout_JSSharedArrayBufferFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sab_opaque) as usize - ptr as usize }, - 12usize, + 24usize, concat!( "Offset of field: ", stringify!(JSSharedArrayBufferFunctions), @@ -1800,6 +1835,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1896,6 +1938,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1910,8 +1993,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1922,6 +2004,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2019,12 +2110,12 @@ fn bindgen_test_layout_JSCFunctionType() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 4usize, + 8usize, concat!("Size of: ", stringify!(JSCFunctionType)) ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!("Alignment of ", stringify!(JSCFunctionType)) ); assert_eq!( @@ -2206,7 +2297,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 8usize, + 16usize, concat!( "Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1) @@ -2214,7 +2305,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!( "Alignment of ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1) @@ -2242,7 +2333,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cfunc) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1), @@ -2264,7 +2355,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 8usize, + 16usize, concat!( "Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2) @@ -2272,7 +2363,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!( "Alignment of ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2) @@ -2290,7 +2381,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).set) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2), @@ -2312,7 +2403,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 8usize, + 16usize, concat!( "Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3) @@ -2320,7 +2411,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3() { ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!( "Alignment of ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3) @@ -2338,7 +2429,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).base) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3), @@ -2360,7 +2451,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 8usize, + 16usize, concat!( "Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4) @@ -2368,7 +2459,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4() { ); assert_eq!( ::std::mem::align_of::(), - 4usize, + 8usize, concat!( "Alignment of ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4) @@ -2386,7 +2477,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4), @@ -2402,7 +2493,7 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 8usize, + 16usize, concat!("Size of: ", stringify!(JSCFunctionListEntry__bindgen_ty_1)) ); assert_eq!( @@ -2500,7 +2591,7 @@ fn bindgen_test_layout_JSCFunctionListEntry() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 16usize, + 32usize, concat!("Size of: ", stringify!(JSCFunctionListEntry)) ); assert_eq!( @@ -2520,7 +2611,7 @@ fn bindgen_test_layout_JSCFunctionListEntry() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).prop_flags) as usize - ptr as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry), @@ -2530,7 +2621,7 @@ fn bindgen_test_layout_JSCFunctionListEntry() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).def_type) as usize - ptr as usize }, - 5usize, + 9usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry), @@ -2540,7 +2631,7 @@ fn bindgen_test_layout_JSCFunctionListEntry() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, - 6usize, + 10usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry), @@ -2550,7 +2641,7 @@ fn bindgen_test_layout_JSCFunctionListEntry() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSCFunctionListEntry), @@ -2608,6 +2699,9 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; pub const JS_ATOM_null: _bindgen_ty_2 = 1; pub const JS_ATOM_false: _bindgen_ty_2 = 2; @@ -2656,185 +2750,178 @@ pub const JS_ATOM_static: _bindgen_ty_2 = 44; pub const JS_ATOM_yield: _bindgen_ty_2 = 45; pub const JS_ATOM_await: _bindgen_ty_2 = 46; pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 119; +pub const JS_ATOM_brand: _bindgen_ty_2 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 121; +pub const JS_ATOM_as: _bindgen_ty_2 = 122; +pub const JS_ATOM_from: _bindgen_ty_2 = 123; +pub const JS_ATOM_meta: _bindgen_ty_2 = 124; +pub const JS_ATOM__default_: _bindgen_ty_2 = 125; +pub const JS_ATOM__star_: _bindgen_ty_2 = 126; +pub const JS_ATOM_Module: _bindgen_ty_2 = 127; +pub const JS_ATOM_then: _bindgen_ty_2 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 129; +pub const JS_ATOM_reject: _bindgen_ty_2 = 130; +pub const JS_ATOM_promise: _bindgen_ty_2 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 133; +pub const JS_ATOM_async: _bindgen_ty_2 = 134; +pub const JS_ATOM_exec: _bindgen_ty_2 = 135; +pub const JS_ATOM_groups: _bindgen_ty_2 = 136; +pub const JS_ATOM_indices: _bindgen_ty_2 = 137; +pub const JS_ATOM_status: _bindgen_ty_2 = 138; +pub const JS_ATOM_reason: _bindgen_ty_2 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 143; +pub const JS_ATOM_ok: _bindgen_ty_2 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 145; +pub const JS_ATOM_Object: _bindgen_ty_2 = 146; +pub const JS_ATOM_Array: _bindgen_ty_2 = 147; +pub const JS_ATOM_Error: _bindgen_ty_2 = 148; +pub const JS_ATOM_Number: _bindgen_ty_2 = 149; +pub const JS_ATOM_String: _bindgen_ty_2 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 153; +pub const JS_ATOM_Math: _bindgen_ty_2 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 155; +pub const JS_ATOM_Date: _bindgen_ty_2 = 156; +pub const JS_ATOM_Function: _bindgen_ty_2 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 178; +pub const JS_ATOM_Map: _bindgen_ty_2 = 179; +pub const JS_ATOM_Set: _bindgen_ty_2 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 220; +pub const JS_ATOM_END: _bindgen_ty_2 = 221; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; diff --git a/sys/src/bindings/x86_64-apple-darwin.rs b/sys/src/bindings/x86_64-apple-darwin.rs index 9cb96e73..6934033d 100644 --- a/sys/src/bindings/x86_64-apple-darwin.rs +++ b/sys/src/bindings/x86_64-apple-darwin.rs @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -83,10 +86,8 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; pub const JS_TAG_STRING: _bindgen_ty_1 = -7; pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; @@ -102,36 +103,6 @@ pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSRefCountHeader), - "::", - stringify!(ref_count) - ) - ); -} -#[repr(C)] #[derive(Copy, Clone)] pub union JSValueUnion { pub int32: i32, @@ -253,79 +224,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -339,7 +257,7 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 40usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( @@ -348,8 +266,18 @@ fn bindgen_test_layout_JSMallocFunctions() { concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -359,7 +287,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -369,7 +297,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -379,7 +307,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 24usize, + 32usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -402,6 +330,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -476,9 +410,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -504,16 +435,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); +} +extern "C" { + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -523,6 +469,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -545,6 +498,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -609,8 +569,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -624,7 +582,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -832,29 +790,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -864,7 +802,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -874,7 +812,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -884,7 +822,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -894,7 +832,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -904,7 +842,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -1292,7 +1230,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1307,6 +1245,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1319,6 +1260,9 @@ extern "C" { extern "C" { pub fn JS_GetException(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_HasException(ctx: *mut JSContext) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } @@ -1328,6 +1272,13 @@ extern "C" { extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1367,10 +1318,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); +} +extern "C" { + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; +} +extern "C" { + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1395,6 +1352,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1409,9 +1373,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1471,13 +1432,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1487,16 +1448,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1554,6 +1510,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1571,6 +1534,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1703,20 +1669,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1753,6 +1713,12 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; +} extern "C" { pub fn JS_GetTypedArrayBuffer( ctx: *mut JSContext, @@ -1762,6 +1728,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1854,6 +1836,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1950,6 +1939,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1964,8 +1994,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1976,6 +2005,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2662,6 +2700,9 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; pub const JS_ATOM_null: _bindgen_ty_2 = 1; pub const JS_ATOM_false: _bindgen_ty_2 = 2; @@ -2710,185 +2751,178 @@ pub const JS_ATOM_static: _bindgen_ty_2 = 44; pub const JS_ATOM_yield: _bindgen_ty_2 = 45; pub const JS_ATOM_await: _bindgen_ty_2 = 46; pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 119; +pub const JS_ATOM_brand: _bindgen_ty_2 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 121; +pub const JS_ATOM_as: _bindgen_ty_2 = 122; +pub const JS_ATOM_from: _bindgen_ty_2 = 123; +pub const JS_ATOM_meta: _bindgen_ty_2 = 124; +pub const JS_ATOM__default_: _bindgen_ty_2 = 125; +pub const JS_ATOM__star_: _bindgen_ty_2 = 126; +pub const JS_ATOM_Module: _bindgen_ty_2 = 127; +pub const JS_ATOM_then: _bindgen_ty_2 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 129; +pub const JS_ATOM_reject: _bindgen_ty_2 = 130; +pub const JS_ATOM_promise: _bindgen_ty_2 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 133; +pub const JS_ATOM_async: _bindgen_ty_2 = 134; +pub const JS_ATOM_exec: _bindgen_ty_2 = 135; +pub const JS_ATOM_groups: _bindgen_ty_2 = 136; +pub const JS_ATOM_indices: _bindgen_ty_2 = 137; +pub const JS_ATOM_status: _bindgen_ty_2 = 138; +pub const JS_ATOM_reason: _bindgen_ty_2 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 143; +pub const JS_ATOM_ok: _bindgen_ty_2 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 145; +pub const JS_ATOM_Object: _bindgen_ty_2 = 146; +pub const JS_ATOM_Array: _bindgen_ty_2 = 147; +pub const JS_ATOM_Error: _bindgen_ty_2 = 148; +pub const JS_ATOM_Number: _bindgen_ty_2 = 149; +pub const JS_ATOM_String: _bindgen_ty_2 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 153; +pub const JS_ATOM_Math: _bindgen_ty_2 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 155; +pub const JS_ATOM_Date: _bindgen_ty_2 = 156; +pub const JS_ATOM_Function: _bindgen_ty_2 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 178; +pub const JS_ATOM_Map: _bindgen_ty_2 = 179; +pub const JS_ATOM_Set: _bindgen_ty_2 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 220; +pub const JS_ATOM_END: _bindgen_ty_2 = 221; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; diff --git a/sys/src/bindings/x86_64-pc-windows-gnu.rs b/sys/src/bindings/x86_64-pc-windows-gnu.rs index dcc31fd0..1f898200 100644 --- a/sys/src/bindings/x86_64-pc-windows-gnu.rs +++ b/sys/src/bindings/x86_64-pc-windows-gnu.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.69.5 */ pub const JS_PROP_CONFIGURABLE: u32 = 1; pub const JS_PROP_WRITABLE: u32 = 2; @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -82,10 +85,8 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; pub const JS_TAG_STRING: _bindgen_ty_1 = -7; pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; @@ -101,36 +102,6 @@ pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSRefCountHeader), - "::", - stringify!(ref_count) - ) - ); -} -#[repr(C)] #[derive(Copy, Clone)] pub union JSValueUnion { pub int32: i32, @@ -252,79 +223,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -338,7 +256,7 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 40usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( @@ -347,8 +265,18 @@ fn bindgen_test_layout_JSMallocFunctions() { concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -358,7 +286,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -368,7 +296,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -378,7 +306,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 24usize, + 32usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -387,6 +315,9 @@ fn bindgen_test_layout_JSMallocFunctions() { ) ); } +pub type JSRuntimeFinalizer = ::std::option::Option< + unsafe extern "C" fn(rt: *mut JSRuntime, arg: *mut ::std::os::raw::c_void), +>; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSGCObjectHeader { @@ -401,6 +332,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -425,6 +362,13 @@ extern "C" { extern "C" { pub fn JS_SetRuntimeOpaque(rt: *mut JSRuntime, opaque: *mut ::std::os::raw::c_void); } +extern "C" { + pub fn JS_AddRuntimeFinalizer( + rt: *mut JSRuntime, + finalizer: JSRuntimeFinalizer, + arg: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} pub type JS_MarkFunc = ::std::option::Option; extern "C" { @@ -475,9 +419,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -503,16 +444,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -522,6 +478,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -544,6 +507,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -608,8 +578,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -623,7 +591,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -831,29 +799,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -863,7 +811,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -873,7 +821,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -883,7 +831,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -893,7 +841,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -903,7 +851,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -1291,7 +1239,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1306,6 +1254,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1318,6 +1269,9 @@ extern "C" { extern "C" { pub fn JS_GetException(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_HasException(ctx: *mut JSContext) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } @@ -1327,6 +1281,13 @@ extern "C" { extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1366,10 +1327,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); +} +extern "C" { + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); +} +extern "C" { + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1394,6 +1361,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1408,9 +1382,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1470,13 +1441,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1486,16 +1457,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1553,6 +1519,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1570,6 +1543,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1702,20 +1678,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1752,6 +1722,12 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; +} extern "C" { pub fn JS_GetTypedArrayBuffer( ctx: *mut JSContext, @@ -1761,6 +1737,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1853,6 +1845,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1949,6 +1948,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1963,8 +2003,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1975,6 +2014,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2661,6 +2709,9 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; pub const JS_ATOM_null: _bindgen_ty_2 = 1; pub const JS_ATOM_false: _bindgen_ty_2 = 2; @@ -2709,185 +2760,178 @@ pub const JS_ATOM_static: _bindgen_ty_2 = 44; pub const JS_ATOM_yield: _bindgen_ty_2 = 45; pub const JS_ATOM_await: _bindgen_ty_2 = 46; pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; -pub type _bindgen_ty_2 = ::std::os::raw::c_uint; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 119; +pub const JS_ATOM_brand: _bindgen_ty_2 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 121; +pub const JS_ATOM_as: _bindgen_ty_2 = 122; +pub const JS_ATOM_from: _bindgen_ty_2 = 123; +pub const JS_ATOM_meta: _bindgen_ty_2 = 124; +pub const JS_ATOM__default_: _bindgen_ty_2 = 125; +pub const JS_ATOM__star_: _bindgen_ty_2 = 126; +pub const JS_ATOM_Module: _bindgen_ty_2 = 127; +pub const JS_ATOM_then: _bindgen_ty_2 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 129; +pub const JS_ATOM_reject: _bindgen_ty_2 = 130; +pub const JS_ATOM_promise: _bindgen_ty_2 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 133; +pub const JS_ATOM_async: _bindgen_ty_2 = 134; +pub const JS_ATOM_exec: _bindgen_ty_2 = 135; +pub const JS_ATOM_groups: _bindgen_ty_2 = 136; +pub const JS_ATOM_indices: _bindgen_ty_2 = 137; +pub const JS_ATOM_status: _bindgen_ty_2 = 138; +pub const JS_ATOM_reason: _bindgen_ty_2 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 143; +pub const JS_ATOM_ok: _bindgen_ty_2 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 145; +pub const JS_ATOM_Object: _bindgen_ty_2 = 146; +pub const JS_ATOM_Array: _bindgen_ty_2 = 147; +pub const JS_ATOM_Error: _bindgen_ty_2 = 148; +pub const JS_ATOM_Number: _bindgen_ty_2 = 149; +pub const JS_ATOM_String: _bindgen_ty_2 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 153; +pub const JS_ATOM_Math: _bindgen_ty_2 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 155; +pub const JS_ATOM_Date: _bindgen_ty_2 = 156; +pub const JS_ATOM_Function: _bindgen_ty_2 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 178; +pub const JS_ATOM_Map: _bindgen_ty_2 = 179; +pub const JS_ATOM_Set: _bindgen_ty_2 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 220; +pub const JS_ATOM_END: _bindgen_ty_2 = 221; +pub type _bindgen_ty_2 = ::std::os::raw::c_uint; \ No newline at end of file diff --git a/sys/src/bindings/x86_64-pc-windows-msvc.rs b/sys/src/bindings/x86_64-pc-windows-msvc.rs index f6e4e558..d9b922b7 100644 --- a/sys/src/bindings/x86_64-pc-windows-msvc.rs +++ b/sys/src/bindings/x86_64-pc-windows-msvc.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.69.5 */ pub const JS_PROP_CONFIGURABLE: u32 = 1; pub const JS_PROP_WRITABLE: u32 = 2; @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -82,10 +85,8 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; pub const JS_TAG_STRING: _bindgen_ty_1 = -7; pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; @@ -101,36 +102,6 @@ pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSRefCountHeader), - "::", - stringify!(ref_count) - ) - ); -} -#[repr(C)] #[derive(Copy, Clone)] pub union JSValueUnion { pub int32: i32, @@ -252,79 +223,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -338,7 +256,7 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 40usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( @@ -347,8 +265,18 @@ fn bindgen_test_layout_JSMallocFunctions() { concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -358,7 +286,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -368,7 +296,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -378,7 +306,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 24usize, + 32usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -387,6 +315,9 @@ fn bindgen_test_layout_JSMallocFunctions() { ) ); } +pub type JSRuntimeFinalizer = ::std::option::Option< + unsafe extern "C" fn(rt: *mut JSRuntime, arg: *mut ::std::os::raw::c_void), +>; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSGCObjectHeader { @@ -401,6 +332,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -425,6 +362,13 @@ extern "C" { extern "C" { pub fn JS_SetRuntimeOpaque(rt: *mut JSRuntime, opaque: *mut ::std::os::raw::c_void); } +extern "C" { + pub fn JS_AddRuntimeFinalizer( + rt: *mut JSRuntime, + finalizer: JSRuntimeFinalizer, + arg: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} pub type JS_MarkFunc = ::std::option::Option; extern "C" { @@ -475,9 +419,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -503,16 +444,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -522,6 +478,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -544,6 +507,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -608,8 +578,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -623,7 +591,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -831,29 +799,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -863,7 +811,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -873,7 +821,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -883,7 +831,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -893,7 +841,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -903,7 +851,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -1291,7 +1239,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1306,6 +1254,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1318,6 +1269,9 @@ extern "C" { extern "C" { pub fn JS_GetException(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_HasException(ctx: *mut JSContext) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } @@ -1327,6 +1281,13 @@ extern "C" { extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1366,10 +1327,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); +} +extern "C" { + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); +} +extern "C" { + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1394,6 +1361,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1408,9 +1382,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1470,13 +1441,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1486,16 +1457,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1553,6 +1519,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1570,6 +1543,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1702,20 +1678,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1752,6 +1722,12 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; +} extern "C" { pub fn JS_GetTypedArrayBuffer( ctx: *mut JSContext, @@ -1761,6 +1737,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1853,6 +1845,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1949,6 +1948,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1963,8 +2003,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1975,6 +2014,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2661,6 +2709,9 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; pub const JS_ATOM_null: _bindgen_ty_2 = 1; pub const JS_ATOM_false: _bindgen_ty_2 = 2; @@ -2709,185 +2760,178 @@ pub const JS_ATOM_static: _bindgen_ty_2 = 44; pub const JS_ATOM_yield: _bindgen_ty_2 = 45; pub const JS_ATOM_await: _bindgen_ty_2 = 46; pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; -pub type _bindgen_ty_2 = ::std::os::raw::c_int; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 119; +pub const JS_ATOM_brand: _bindgen_ty_2 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 121; +pub const JS_ATOM_as: _bindgen_ty_2 = 122; +pub const JS_ATOM_from: _bindgen_ty_2 = 123; +pub const JS_ATOM_meta: _bindgen_ty_2 = 124; +pub const JS_ATOM__default_: _bindgen_ty_2 = 125; +pub const JS_ATOM__star_: _bindgen_ty_2 = 126; +pub const JS_ATOM_Module: _bindgen_ty_2 = 127; +pub const JS_ATOM_then: _bindgen_ty_2 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 129; +pub const JS_ATOM_reject: _bindgen_ty_2 = 130; +pub const JS_ATOM_promise: _bindgen_ty_2 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 133; +pub const JS_ATOM_async: _bindgen_ty_2 = 134; +pub const JS_ATOM_exec: _bindgen_ty_2 = 135; +pub const JS_ATOM_groups: _bindgen_ty_2 = 136; +pub const JS_ATOM_indices: _bindgen_ty_2 = 137; +pub const JS_ATOM_status: _bindgen_ty_2 = 138; +pub const JS_ATOM_reason: _bindgen_ty_2 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 143; +pub const JS_ATOM_ok: _bindgen_ty_2 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 145; +pub const JS_ATOM_Object: _bindgen_ty_2 = 146; +pub const JS_ATOM_Array: _bindgen_ty_2 = 147; +pub const JS_ATOM_Error: _bindgen_ty_2 = 148; +pub const JS_ATOM_Number: _bindgen_ty_2 = 149; +pub const JS_ATOM_String: _bindgen_ty_2 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 153; +pub const JS_ATOM_Math: _bindgen_ty_2 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 155; +pub const JS_ATOM_Date: _bindgen_ty_2 = 156; +pub const JS_ATOM_Function: _bindgen_ty_2 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 178; +pub const JS_ATOM_Map: _bindgen_ty_2 = 179; +pub const JS_ATOM_Set: _bindgen_ty_2 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 220; +pub const JS_ATOM_END: _bindgen_ty_2 = 221; +pub type _bindgen_ty_2 = ::std::os::raw::c_int; \ No newline at end of file diff --git a/sys/src/bindings/x86_64-unknown-linux-gnu.rs b/sys/src/bindings/x86_64-unknown-linux-gnu.rs index 567b297d..fa0f0103 100644 --- a/sys/src/bindings/x86_64-unknown-linux-gnu.rs +++ b/sys/src/bindings/x86_64-unknown-linux-gnu.rs @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -82,10 +85,8 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; pub const JS_TAG_STRING: _bindgen_ty_1 = -7; pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; @@ -101,36 +102,6 @@ pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSRefCountHeader), - "::", - stringify!(ref_count) - ) - ); -} -#[repr(C)] #[derive(Copy, Clone)] pub union JSValueUnion { pub int32: i32, @@ -252,79 +223,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -338,7 +256,7 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 40usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( @@ -347,8 +265,18 @@ fn bindgen_test_layout_JSMallocFunctions() { concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -358,7 +286,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -368,7 +296,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -378,7 +306,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 24usize, + 32usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -401,6 +329,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -475,9 +409,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -503,16 +434,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); +} +extern "C" { + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -522,6 +468,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -544,6 +497,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -608,8 +568,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -623,7 +581,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -831,29 +789,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -863,7 +801,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -873,7 +811,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -883,7 +821,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -893,7 +831,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -903,7 +841,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -1291,7 +1229,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1306,6 +1244,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1318,6 +1259,9 @@ extern "C" { extern "C" { pub fn JS_GetException(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_HasException(ctx: *mut JSContext) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } @@ -1327,6 +1271,13 @@ extern "C" { extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1366,10 +1317,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); +} +extern "C" { + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; +} +extern "C" { + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1394,6 +1351,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1408,9 +1372,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1470,13 +1431,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1486,16 +1447,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1553,6 +1509,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1570,6 +1533,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1702,20 +1668,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1752,6 +1712,12 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; +} extern "C" { pub fn JS_GetTypedArrayBuffer( ctx: *mut JSContext, @@ -1761,6 +1727,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1853,6 +1835,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1949,6 +1938,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1963,8 +1993,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1975,6 +2004,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2661,6 +2699,9 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; pub const JS_ATOM_null: _bindgen_ty_2 = 1; pub const JS_ATOM_false: _bindgen_ty_2 = 2; @@ -2709,185 +2750,178 @@ pub const JS_ATOM_static: _bindgen_ty_2 = 44; pub const JS_ATOM_yield: _bindgen_ty_2 = 45; pub const JS_ATOM_await: _bindgen_ty_2 = 46; pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 119; +pub const JS_ATOM_brand: _bindgen_ty_2 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 121; +pub const JS_ATOM_as: _bindgen_ty_2 = 122; +pub const JS_ATOM_from: _bindgen_ty_2 = 123; +pub const JS_ATOM_meta: _bindgen_ty_2 = 124; +pub const JS_ATOM__default_: _bindgen_ty_2 = 125; +pub const JS_ATOM__star_: _bindgen_ty_2 = 126; +pub const JS_ATOM_Module: _bindgen_ty_2 = 127; +pub const JS_ATOM_then: _bindgen_ty_2 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 129; +pub const JS_ATOM_reject: _bindgen_ty_2 = 130; +pub const JS_ATOM_promise: _bindgen_ty_2 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 133; +pub const JS_ATOM_async: _bindgen_ty_2 = 134; +pub const JS_ATOM_exec: _bindgen_ty_2 = 135; +pub const JS_ATOM_groups: _bindgen_ty_2 = 136; +pub const JS_ATOM_indices: _bindgen_ty_2 = 137; +pub const JS_ATOM_status: _bindgen_ty_2 = 138; +pub const JS_ATOM_reason: _bindgen_ty_2 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 143; +pub const JS_ATOM_ok: _bindgen_ty_2 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 145; +pub const JS_ATOM_Object: _bindgen_ty_2 = 146; +pub const JS_ATOM_Array: _bindgen_ty_2 = 147; +pub const JS_ATOM_Error: _bindgen_ty_2 = 148; +pub const JS_ATOM_Number: _bindgen_ty_2 = 149; +pub const JS_ATOM_String: _bindgen_ty_2 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 153; +pub const JS_ATOM_Math: _bindgen_ty_2 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 155; +pub const JS_ATOM_Date: _bindgen_ty_2 = 156; +pub const JS_ATOM_Function: _bindgen_ty_2 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 178; +pub const JS_ATOM_Map: _bindgen_ty_2 = 179; +pub const JS_ATOM_Set: _bindgen_ty_2 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 220; +pub const JS_ATOM_END: _bindgen_ty_2 = 221; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; diff --git a/sys/src/bindings/x86_64-unknown-linux-musl.rs b/sys/src/bindings/x86_64-unknown-linux-musl.rs index 567b297d..fa0f0103 100644 --- a/sys/src/bindings/x86_64-unknown-linux-musl.rs +++ b/sys/src/bindings/x86_64-unknown-linux-musl.rs @@ -21,6 +21,8 @@ pub const JS_PROP_THROW: u32 = 16384; pub const JS_PROP_THROW_STRICT: u32 = 32768; pub const JS_PROP_NO_ADD: u32 = 65536; pub const JS_PROP_NO_EXOTIC: u32 = 131072; +pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144; +pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288; pub const JS_DEFAULT_STACK_SIZE: u32 = 262144; pub const JS_EVAL_TYPE_GLOBAL: u32 = 0; pub const JS_EVAL_TYPE_MODULE: u32 = 1; @@ -28,7 +30,7 @@ pub const JS_EVAL_TYPE_DIRECT: u32 = 2; pub const JS_EVAL_TYPE_INDIRECT: u32 = 3; pub const JS_EVAL_TYPE_MASK: u32 = 3; pub const JS_EVAL_FLAG_STRICT: u32 = 8; -pub const JS_EVAL_FLAG_STRIP: u32 = 16; +pub const JS_EVAL_FLAG_UNUSED: u32 = 16; pub const JS_EVAL_FLAG_COMPILE_ONLY: u32 = 32; pub const JS_EVAL_FLAG_BACKTRACE_BARRIER: u32 = 64; pub const JS_EVAL_FLAG_ASYNC: u32 = 128; @@ -40,13 +42,14 @@ pub const JS_GPN_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; -pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; -pub const JS_WRITE_OBJ_BSWAP: u32 = 2; +pub const JS_WRITE_OBJ_BSWAP: u32 = 0; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REFERENCE: u32 = 8; +pub const JS_WRITE_OBJ_STRIP_SOURCE: u32 = 16; +pub const JS_WRITE_OBJ_STRIP_DEBUG: u32 = 32; pub const JS_READ_OBJ_BYTECODE: u32 = 1; -pub const JS_READ_OBJ_ROM_DATA: u32 = 2; +pub const JS_READ_OBJ_ROM_DATA: u32 = 0; pub const JS_READ_OBJ_SAB: u32 = 4; pub const JS_READ_OBJ_REFERENCE: u32 = 8; pub const JS_DEF_CFUNC: u32 = 0; @@ -82,10 +85,8 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_DECIMAL: _bindgen_ty_1 = -11; -pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -10; -pub const JS_TAG_BIG_FLOAT: _bindgen_ty_1 = -9; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; pub const JS_TAG_STRING: _bindgen_ty_1 = -7; pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; @@ -101,36 +102,6 @@ pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 7; pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JSRefCountHeader { - pub ref_count: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_JSRefCountHeader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JSRefCountHeader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSRefCountHeader), - "::", - stringify!(ref_count) - ) - ); -} -#[repr(C)] #[derive(Copy, Clone)] pub union JSValueUnion { pub int32: i32, @@ -252,79 +223,26 @@ pub type JSCFunctionData = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct JSMallocState { - pub malloc_count: size_t, - pub malloc_size: size_t, - pub malloc_limit: size_t, - pub opaque: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JSMallocState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(JSMallocState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JSMallocState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(malloc_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JSMallocState), - "::", - stringify!(opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct JSMallocFunctions { + pub js_calloc: ::std::option::Option< + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void, + >, pub js_malloc: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, size: size_t) -> *mut ::std::os::raw::c_void, + unsafe extern "C" fn( + opaque: *mut ::std::os::raw::c_void, + size: size_t, + ) -> *mut ::std::os::raw::c_void, >, pub js_free: ::std::option::Option< - unsafe extern "C" fn(s: *mut JSMallocState, ptr: *mut ::std::os::raw::c_void), + unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void), >, pub js_realloc: ::std::option::Option< unsafe extern "C" fn( - s: *mut JSMallocState, + opaque: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void, size: size_t, ) -> *mut ::std::os::raw::c_void, @@ -338,7 +256,7 @@ fn bindgen_test_layout_JSMallocFunctions() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 40usize, concat!("Size of: ", stringify!(JSMallocFunctions)) ); assert_eq!( @@ -347,8 +265,18 @@ fn bindgen_test_layout_JSMallocFunctions() { concat!("Alignment of ", stringify!(JSMallocFunctions)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).js_calloc) as usize - ptr as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(JSMallocFunctions), + "::", + stringify!(js_calloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).js_malloc) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -358,7 +286,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_free) as usize - ptr as usize }, - 8usize, + 16usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -368,7 +296,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_realloc) as usize - ptr as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -378,7 +306,7 @@ fn bindgen_test_layout_JSMallocFunctions() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).js_malloc_usable_size) as usize - ptr as usize }, - 24usize, + 32usize, concat!( "Offset of field: ", stringify!(JSMallocFunctions), @@ -401,6 +329,12 @@ extern "C" { extern "C" { pub fn JS_SetMemoryLimit(rt: *mut JSRuntime, limit: size_t); } +extern "C" { + pub fn JS_SetDumpFlags(rt: *mut JSRuntime, flags: u64); +} +extern "C" { + pub fn JS_GetGCThreshold(rt: *mut JSRuntime) -> size_t; +} extern "C" { pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t); } @@ -475,9 +409,6 @@ extern "C" { extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } -extern "C" { - pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); -} extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } @@ -503,16 +434,31 @@ extern "C" { pub fn JS_AddIntrinsicBigInt(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigFloat(ctx: *mut JSContext); + pub fn JS_AddIntrinsicWeakRef(ctx: *mut JSContext); +} +extern "C" { + pub fn JS_AddPerformance(ctx: *mut JSContext); } extern "C" { - pub fn JS_AddIntrinsicBigDecimal(ctx: *mut JSContext); + pub fn JS_IsEqual(ctx: *mut JSContext, op1: JSValue, op2: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_IsStrictEqual( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_AddIntrinsicOperators(ctx: *mut JSContext); + pub fn JS_IsSameValue(ctx: *mut JSContext, op1: JSValue, op2: JSValue) + -> ::std::os::raw::c_int; } extern "C" { - pub fn JS_EnableBignumExt(ctx: *mut JSContext, enable: ::std::os::raw::c_int); + pub fn JS_IsSameValueZero( + ctx: *mut JSContext, + op1: JSValue, + op2: JSValue, + ) -> ::std::os::raw::c_int; } extern "C" { pub fn js_string_codePointRange( @@ -522,6 +468,13 @@ extern "C" { argv: *mut JSValue, ) -> JSValue; } +extern "C" { + pub fn js_calloc_rt( + rt: *mut JSRuntime, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -544,6 +497,13 @@ extern "C" { extern "C" { pub fn js_mallocz_rt(rt: *mut JSRuntime, size: size_t) -> *mut ::std::os::raw::c_void; } +extern "C" { + pub fn js_calloc( + ctx: *mut JSContext, + count: size_t, + size: size_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn js_malloc(ctx: *mut JSContext, size: size_t) -> *mut ::std::os::raw::c_void; } @@ -608,8 +568,6 @@ pub struct JSMemoryUsage { pub js_func_code_size: i64, pub js_func_pc2line_count: i64, pub js_func_pc2line_size: i64, - pub js_func_pc2column_count: i64, - pub js_func_pc2column_size: i64, pub c_func_count: i64, pub array_count: i64, pub fast_array_count: i64, @@ -623,7 +581,7 @@ fn bindgen_test_layout_JSMemoryUsage() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 224usize, + 208usize, concat!("Size of: ", stringify!(JSMemoryUsage)) ); assert_eq!( @@ -831,29 +789,9 @@ fn bindgen_test_layout_JSMemoryUsage() { stringify!(js_func_pc2line_size) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_count) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).js_func_pc2column_size) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JSMemoryUsage), - "::", - stringify!(js_func_pc2column_size) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).c_func_count) as usize - ptr as usize }, - 176usize, + 160usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -863,7 +801,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).array_count) as usize - ptr as usize }, - 184usize, + 168usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -873,7 +811,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_count) as usize - ptr as usize }, - 192usize, + 176usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -883,7 +821,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fast_array_elements) as usize - ptr as usize }, - 200usize, + 184usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -893,7 +831,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_count) as usize - ptr as usize }, - 208usize, + 192usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -903,7 +841,7 @@ fn bindgen_test_layout_JSMemoryUsage() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).binary_object_size) as usize - ptr as usize }, - 216usize, + 200usize, concat!( "Offset of field: ", stringify!(JSMemoryUsage), @@ -1291,7 +1229,7 @@ fn bindgen_test_layout_JSClassDef() { ); } extern "C" { - pub fn JS_NewClassID(pclass_id: *mut JSClassID) -> JSClassID; + pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; } extern "C" { pub fn JS_GetClassID(v: JSValue) -> JSClassID; @@ -1306,6 +1244,9 @@ extern "C" { extern "C" { pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue; +} extern "C" { pub fn JS_NewBigInt64(ctx: *mut JSContext, v: i64) -> JSValue; } @@ -1318,6 +1259,9 @@ extern "C" { extern "C" { pub fn JS_GetException(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_HasException(ctx: *mut JSContext) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; } @@ -1327,6 +1271,13 @@ extern "C" { extern "C" { pub fn JS_NewError(ctx: *mut JSContext) -> JSValue; } +extern "C" { + pub fn JS_ThrowPlainError( + ctx: *mut JSContext, + fmt: *const ::std::os::raw::c_char, + ... + ) -> JSValue; +} extern "C" { pub fn JS_ThrowSyntaxError( ctx: *mut JSContext, @@ -1366,10 +1317,16 @@ extern "C" { pub fn JS_ThrowOutOfMemory(ctx: *mut JSContext) -> JSValue; } extern "C" { - pub fn __JS_FreeValue(ctx: *mut JSContext, v: JSValue); + pub fn JS_FreeValue(ctx: *mut JSContext, v: JSValue); +} +extern "C" { + pub fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); } extern "C" { - pub fn __JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue); + pub fn JS_DupValue(ctx: *mut JSContext, v: JSValue) -> JSValue; +} +extern "C" { + pub fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) -> JSValue; } extern "C" { pub fn JS_ToBool(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int; @@ -1394,6 +1351,13 @@ extern "C" { val: JSValue, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_ToBigUint64( + ctx: *mut JSContext, + pres: *mut u64, + val: JSValue, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_ToInt64Ext( ctx: *mut JSContext, @@ -1408,9 +1372,6 @@ extern "C" { len1: size_t, ) -> JSValue; } -extern "C" { - pub fn JS_NewString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; -} extern "C" { pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue; } @@ -1470,13 +1431,13 @@ extern "C" { pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue; } extern "C" { - pub fn JS_GetPropertyInternal( - ctx: *mut JSContext, - obj: JSValue, - prop: JSAtom, - receiver: JSValue, - throw_ref_error: ::std::os::raw::c_int, - ) -> JSValue; + pub fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; +} +extern "C" { + pub fn JS_GetPropertyInt64(ctx: *mut JSContext, this_obj: JSValue, idx: i64) -> JSValue; } extern "C" { pub fn JS_GetPropertyStr( @@ -1486,16 +1447,11 @@ extern "C" { ) -> JSValue; } extern "C" { - pub fn JS_GetPropertyUint32(ctx: *mut JSContext, this_obj: JSValue, idx: u32) -> JSValue; -} -extern "C" { - pub fn JS_SetPropertyInternal( + pub fn JS_SetProperty( ctx: *mut JSContext, - obj: JSValue, + this_obj: JSValue, prop: JSAtom, val: JSValue, - this_obj: JSValue, - flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { @@ -1553,6 +1509,13 @@ extern "C" { extern "C" { pub fn JS_GetPrototype(ctx: *mut JSContext, val: JSValue) -> JSValue; } +extern "C" { + pub fn JS_GetLength(ctx: *mut JSContext, obj: JSValue, pres: *mut i64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_SetLength(ctx: *mut JSContext, obj: JSValue, len: i64) -> ::std::os::raw::c_int; +} extern "C" { pub fn JS_GetOwnPropertyNames( ctx: *mut JSContext, @@ -1570,6 +1533,9 @@ extern "C" { prop: JSAtom, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_FreePropertyEnum(ctx: *mut JSContext, tab: *mut JSPropertyEnum, len: u32); +} extern "C" { pub fn JS_Call( ctx: *mut JSContext, @@ -1702,20 +1668,14 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON( - ctx: *mut JSContext, - buf: *const ::std::os::raw::c_char, - buf_len: size_t, - filename: *const ::std::os::raw::c_char, - ) -> JSValue; + pub fn JS_GetAnyOpaque(obj: JSValue, class_id: *mut JSClassID) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn JS_ParseJSON2( + pub fn JS_ParseJSON( ctx: *mut JSContext, buf: *const ::std::os::raw::c_char, buf_len: size_t, filename: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, ) -> JSValue; } extern "C" { @@ -1752,6 +1712,12 @@ extern "C" { extern "C" { pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; } +extern "C" { + pub fn JS_IsArrayBuffer(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8; +} extern "C" { pub fn JS_GetTypedArrayBuffer( ctx: *mut JSContext, @@ -1761,6 +1727,22 @@ extern "C" { pbytes_per_element: *mut size_t, ) -> JSValue; } +extern "C" { + pub fn JS_NewUint8Array( + ctx: *mut JSContext, + buf: *mut u8, + len: size_t, + free_func: JSFreeArrayBufferDataFunc, + opaque: *mut ::std::os::raw::c_void, + is_shared: ::std::os::raw::c_int, + ) -> JSValue; +} +extern "C" { + pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: size_t) -> JSValue; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSSharedArrayBufferFunctions { @@ -1853,6 +1835,13 @@ extern "C" { extern "C" { pub fn JS_PromiseResult(ctx: *mut JSContext, promise: JSValue) -> JSValue; } +extern "C" { + pub fn JS_NewSymbol( + ctx: *mut JSContext, + description: *const ::std::os::raw::c_char, + is_global: ::std::os::raw::c_int, + ) -> JSValue; +} pub type JSHostPromiseRejectionTracker = ::std::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -1949,6 +1938,47 @@ extern "C" { pctx: *mut *mut JSContext, ) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct JSSABTab { + pub tab: *mut *mut u8, + pub len: size_t, +} +#[test] +fn bindgen_test_layout_JSSABTab() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(JSSABTab)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(JSSABTab)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tab) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(tab) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(JSSABTab), + "::", + stringify!(len) + ) + ); +} extern "C" { pub fn JS_WriteObject( ctx: *mut JSContext, @@ -1963,8 +1993,7 @@ extern "C" { psize: *mut size_t, obj: JSValue, flags: ::std::os::raw::c_int, - psab_tab: *mut *mut *mut u8, - psab_tab_len: *mut size_t, + psab_tab: *mut JSSABTab, ) -> *mut u8; } extern "C" { @@ -1975,6 +2004,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> JSValue; } +extern "C" { + pub fn JS_ReadObject2( + ctx: *mut JSContext, + buf: *const u8, + buf_len: size_t, + flags: ::std::os::raw::c_int, + psab_tab: *mut JSSABTab, + ) -> JSValue; +} extern "C" { pub fn JS_EvalFunction(ctx: *mut JSContext, fun_obj: JSValue) -> JSValue; } @@ -2661,6 +2699,9 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn JS_GetVersion() -> *const ::std::os::raw::c_char; +} pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; pub const JS_ATOM_null: _bindgen_ty_2 = 1; pub const JS_ATOM_false: _bindgen_ty_2 = 2; @@ -2709,185 +2750,178 @@ pub const JS_ATOM_static: _bindgen_ty_2 = 44; pub const JS_ATOM_yield: _bindgen_ty_2 = 45; pub const JS_ATOM_await: _bindgen_ty_2 = 46; pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; -pub const JS_ATOM_length: _bindgen_ty_2 = 48; -pub const JS_ATOM_fileName: _bindgen_ty_2 = 49; -pub const JS_ATOM_lineNumber: _bindgen_ty_2 = 50; -pub const JS_ATOM_columnNumber: _bindgen_ty_2 = 51; -pub const JS_ATOM_message: _bindgen_ty_2 = 52; -pub const JS_ATOM_cause: _bindgen_ty_2 = 53; -pub const JS_ATOM_errors: _bindgen_ty_2 = 54; -pub const JS_ATOM_stack: _bindgen_ty_2 = 55; -pub const JS_ATOM_name: _bindgen_ty_2 = 56; -pub const JS_ATOM_toString: _bindgen_ty_2 = 57; -pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 58; -pub const JS_ATOM_valueOf: _bindgen_ty_2 = 59; -pub const JS_ATOM_eval: _bindgen_ty_2 = 60; -pub const JS_ATOM_prototype: _bindgen_ty_2 = 61; -pub const JS_ATOM_constructor: _bindgen_ty_2 = 62; -pub const JS_ATOM_configurable: _bindgen_ty_2 = 63; -pub const JS_ATOM_writable: _bindgen_ty_2 = 64; -pub const JS_ATOM_enumerable: _bindgen_ty_2 = 65; -pub const JS_ATOM_value: _bindgen_ty_2 = 66; -pub const JS_ATOM_get: _bindgen_ty_2 = 67; -pub const JS_ATOM_set: _bindgen_ty_2 = 68; -pub const JS_ATOM_of: _bindgen_ty_2 = 69; -pub const JS_ATOM___proto__: _bindgen_ty_2 = 70; -pub const JS_ATOM_undefined: _bindgen_ty_2 = 71; -pub const JS_ATOM_number: _bindgen_ty_2 = 72; -pub const JS_ATOM_boolean: _bindgen_ty_2 = 73; -pub const JS_ATOM_string: _bindgen_ty_2 = 74; -pub const JS_ATOM_object: _bindgen_ty_2 = 75; -pub const JS_ATOM_symbol: _bindgen_ty_2 = 76; -pub const JS_ATOM_integer: _bindgen_ty_2 = 77; -pub const JS_ATOM_unknown: _bindgen_ty_2 = 78; -pub const JS_ATOM_arguments: _bindgen_ty_2 = 79; -pub const JS_ATOM_callee: _bindgen_ty_2 = 80; -pub const JS_ATOM_caller: _bindgen_ty_2 = 81; -pub const JS_ATOM__eval_: _bindgen_ty_2 = 82; -pub const JS_ATOM__ret_: _bindgen_ty_2 = 83; -pub const JS_ATOM__var_: _bindgen_ty_2 = 84; -pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 85; -pub const JS_ATOM__with_: _bindgen_ty_2 = 86; -pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 87; -pub const JS_ATOM_target: _bindgen_ty_2 = 88; -pub const JS_ATOM_index: _bindgen_ty_2 = 89; -pub const JS_ATOM_input: _bindgen_ty_2 = 90; -pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 91; -pub const JS_ATOM_apply: _bindgen_ty_2 = 92; -pub const JS_ATOM_join: _bindgen_ty_2 = 93; -pub const JS_ATOM_concat: _bindgen_ty_2 = 94; -pub const JS_ATOM_split: _bindgen_ty_2 = 95; -pub const JS_ATOM_construct: _bindgen_ty_2 = 96; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 97; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 98; -pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 99; -pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 100; -pub const JS_ATOM_has: _bindgen_ty_2 = 101; -pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 102; -pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 103; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 104; -pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 105; -pub const JS_ATOM_add: _bindgen_ty_2 = 106; -pub const JS_ATOM_done: _bindgen_ty_2 = 107; -pub const JS_ATOM_next: _bindgen_ty_2 = 108; -pub const JS_ATOM_values: _bindgen_ty_2 = 109; -pub const JS_ATOM_source: _bindgen_ty_2 = 110; -pub const JS_ATOM_flags: _bindgen_ty_2 = 111; -pub const JS_ATOM_global: _bindgen_ty_2 = 112; -pub const JS_ATOM_unicode: _bindgen_ty_2 = 113; -pub const JS_ATOM_raw: _bindgen_ty_2 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; -pub const JS_ATOM_brand: _bindgen_ty_2 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; -pub const JS_ATOM_as: _bindgen_ty_2 = 123; -pub const JS_ATOM_from: _bindgen_ty_2 = 124; -pub const JS_ATOM_meta: _bindgen_ty_2 = 125; -pub const JS_ATOM__default_: _bindgen_ty_2 = 126; -pub const JS_ATOM__star_: _bindgen_ty_2 = 127; -pub const JS_ATOM_Module: _bindgen_ty_2 = 128; -pub const JS_ATOM_then: _bindgen_ty_2 = 129; -pub const JS_ATOM_resolve: _bindgen_ty_2 = 130; -pub const JS_ATOM_reject: _bindgen_ty_2 = 131; -pub const JS_ATOM_promise: _bindgen_ty_2 = 132; -pub const JS_ATOM_proxy: _bindgen_ty_2 = 133; -pub const JS_ATOM_revoke: _bindgen_ty_2 = 134; -pub const JS_ATOM_async: _bindgen_ty_2 = 135; -pub const JS_ATOM_exec: _bindgen_ty_2 = 136; -pub const JS_ATOM_groups: _bindgen_ty_2 = 137; -pub const JS_ATOM_indices: _bindgen_ty_2 = 138; -pub const JS_ATOM_status: _bindgen_ty_2 = 139; -pub const JS_ATOM_reason: _bindgen_ty_2 = 140; -pub const JS_ATOM_globalThis: _bindgen_ty_2 = 141; -pub const JS_ATOM_bigint: _bindgen_ty_2 = 142; -pub const JS_ATOM_bigfloat: _bindgen_ty_2 = 143; -pub const JS_ATOM_bigdecimal: _bindgen_ty_2 = 144; -pub const JS_ATOM_roundingMode: _bindgen_ty_2 = 145; -pub const JS_ATOM_maximumSignificantDigits: _bindgen_ty_2 = 146; -pub const JS_ATOM_maximumFractionDigits: _bindgen_ty_2 = 147; -pub const JS_ATOM_not_equal: _bindgen_ty_2 = 148; -pub const JS_ATOM_timed_out: _bindgen_ty_2 = 149; -pub const JS_ATOM_ok: _bindgen_ty_2 = 150; -pub const JS_ATOM_toJSON: _bindgen_ty_2 = 151; -pub const JS_ATOM_Object: _bindgen_ty_2 = 152; -pub const JS_ATOM_Array: _bindgen_ty_2 = 153; -pub const JS_ATOM_Error: _bindgen_ty_2 = 154; -pub const JS_ATOM_Number: _bindgen_ty_2 = 155; -pub const JS_ATOM_String: _bindgen_ty_2 = 156; -pub const JS_ATOM_Boolean: _bindgen_ty_2 = 157; -pub const JS_ATOM_Symbol: _bindgen_ty_2 = 158; -pub const JS_ATOM_Arguments: _bindgen_ty_2 = 159; -pub const JS_ATOM_Math: _bindgen_ty_2 = 160; -pub const JS_ATOM_JSON: _bindgen_ty_2 = 161; -pub const JS_ATOM_Date: _bindgen_ty_2 = 162; -pub const JS_ATOM_Function: _bindgen_ty_2 = 163; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 164; -pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 165; -pub const JS_ATOM_RegExp: _bindgen_ty_2 = 166; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 167; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 168; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 169; -pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 170; -pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 171; -pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 172; -pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 173; -pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 174; -pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 175; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 176; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; -pub const JS_ATOM_BigFloat: _bindgen_ty_2 = 182; -pub const JS_ATOM_BigFloatEnv: _bindgen_ty_2 = 183; -pub const JS_ATOM_BigDecimal: _bindgen_ty_2 = 184; -pub const JS_ATOM_OperatorSet: _bindgen_ty_2 = 185; -pub const JS_ATOM_Operators: _bindgen_ty_2 = 186; -pub const JS_ATOM_Map: _bindgen_ty_2 = 187; -pub const JS_ATOM_Set: _bindgen_ty_2 = 188; -pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 189; -pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 190; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 191; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 192; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 193; -pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 194; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 195; -pub const JS_ATOM_Generator: _bindgen_ty_2 = 196; -pub const JS_ATOM_Proxy: _bindgen_ty_2 = 197; -pub const JS_ATOM_Promise: _bindgen_ty_2 = 198; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 199; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 200; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 201; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 202; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 203; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 204; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 205; -pub const JS_ATOM_EvalError: _bindgen_ty_2 = 206; -pub const JS_ATOM_RangeError: _bindgen_ty_2 = 207; -pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 208; -pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 209; -pub const JS_ATOM_TypeError: _bindgen_ty_2 = 210; -pub const JS_ATOM_URIError: _bindgen_ty_2 = 211; -pub const JS_ATOM_InternalError: _bindgen_ty_2 = 212; -pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 213; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 214; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 215; -pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 216; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 217; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 218; -pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 219; -pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 220; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 221; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 222; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 223; -pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 224; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 225; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 226; -pub const JS_ATOM_Symbol_operatorSet: _bindgen_ty_2 = 227; -pub const JS_ATOM_END: _bindgen_ty_2 = 228; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 114; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 115; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 116; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 117; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 119; +pub const JS_ATOM_brand: _bindgen_ty_2 = 120; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 121; +pub const JS_ATOM_as: _bindgen_ty_2 = 122; +pub const JS_ATOM_from: _bindgen_ty_2 = 123; +pub const JS_ATOM_meta: _bindgen_ty_2 = 124; +pub const JS_ATOM__default_: _bindgen_ty_2 = 125; +pub const JS_ATOM__star_: _bindgen_ty_2 = 126; +pub const JS_ATOM_Module: _bindgen_ty_2 = 127; +pub const JS_ATOM_then: _bindgen_ty_2 = 128; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 129; +pub const JS_ATOM_reject: _bindgen_ty_2 = 130; +pub const JS_ATOM_promise: _bindgen_ty_2 = 131; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 132; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 133; +pub const JS_ATOM_async: _bindgen_ty_2 = 134; +pub const JS_ATOM_exec: _bindgen_ty_2 = 135; +pub const JS_ATOM_groups: _bindgen_ty_2 = 136; +pub const JS_ATOM_indices: _bindgen_ty_2 = 137; +pub const JS_ATOM_status: _bindgen_ty_2 = 138; +pub const JS_ATOM_reason: _bindgen_ty_2 = 139; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 140; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 141; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 142; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 143; +pub const JS_ATOM_ok: _bindgen_ty_2 = 144; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 145; +pub const JS_ATOM_Object: _bindgen_ty_2 = 146; +pub const JS_ATOM_Array: _bindgen_ty_2 = 147; +pub const JS_ATOM_Error: _bindgen_ty_2 = 148; +pub const JS_ATOM_Number: _bindgen_ty_2 = 149; +pub const JS_ATOM_String: _bindgen_ty_2 = 150; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 151; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 152; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 153; +pub const JS_ATOM_Math: _bindgen_ty_2 = 154; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 155; +pub const JS_ATOM_Date: _bindgen_ty_2 = 156; +pub const JS_ATOM_Function: _bindgen_ty_2 = 157; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 158; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 159; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 160; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 161; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 162; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 163; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 164; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 165; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 166; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 167; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 168; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 176; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 177; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 178; +pub const JS_ATOM_Map: _bindgen_ty_2 = 179; +pub const JS_ATOM_Set: _bindgen_ty_2 = 180; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 182; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 185; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 186; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 187; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 189; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 190; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 191; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 192; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 193; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 194; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 195; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 196; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 197; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 198; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 199; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 200; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 201; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 202; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 203; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 204; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 205; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 206; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 207; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 208; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 209; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 210; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 211; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 212; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 213; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 214; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 215; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 220; +pub const JS_ATOM_END: _bindgen_ty_2 = 221; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; diff --git a/sys/src/inlines/common.rs b/sys/src/inlines/common.rs index 4be3dbbf..70876d53 100644 --- a/sys/src/inlines/common.rs +++ b/sys/src/inlines/common.rs @@ -32,17 +32,6 @@ pub unsafe fn JS_IsBigInt(v: JSValue) -> bool { tag == JS_TAG_BIG_INT } -#[inline] -pub unsafe fn JS_IsBigFloat(v: JSValue) -> bool { - let tag = JS_VALUE_GET_TAG(v); - tag == JS_TAG_BIG_FLOAT -} - -#[inline] -pub unsafe fn JS_IsBigDecimal(v: JSValue) -> bool { - let tag = JS_VALUE_GET_TAG(v); - tag == JS_TAG_BIG_DECIMAL -} #[inline] pub unsafe fn JS_IsBool(v: JSValue) -> bool { @@ -92,60 +81,6 @@ pub unsafe fn JS_IsObject(v: JSValue) -> bool { tag == JS_TAG_OBJECT } -#[inline] -pub unsafe fn JS_ValueRefCount(v: JSValue) -> c_int { - let p = &mut *(JS_VALUE_GET_PTR(v) as *mut JSRefCountHeader); - p.ref_count -} - -#[inline] -unsafe fn JS_FreeValueRef(ctx: *mut JSContext, v: JSValue) { - let p = &mut *(JS_VALUE_GET_PTR(v) as *mut JSRefCountHeader); - p.ref_count -= 1; - if p.ref_count <= 0 { - __JS_FreeValue(ctx, v) - } -} - -#[inline] -pub unsafe fn JS_FreeValue(ctx: *mut JSContext, v: JSValue) { - if JS_VALUE_HAS_REF_COUNT(v) { - JS_FreeValueRef(ctx, v); - } -} - -#[inline] -unsafe fn JS_FreeValueRefRT(rt: *mut JSRuntime, v: JSValue) { - let p = &mut *(JS_VALUE_GET_PTR(v) as *mut JSRefCountHeader); - p.ref_count -= 1; - if p.ref_count <= 0 { - __JS_FreeValueRT(rt, v) - } -} - -#[inline] -pub unsafe fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue) { - if JS_VALUE_HAS_REF_COUNT(v) { - JS_FreeValueRefRT(rt, v); - } -} - -#[inline] -unsafe fn JS_DupValueRef(v: JSValueConst) -> JSValue { - let p = &mut *(JS_VALUE_GET_PTR(v) as *mut JSRefCountHeader); - p.ref_count += 1; - v -} - -#[inline] -pub unsafe fn JS_DupValue(v: JSValue) -> JSValue { - if JS_VALUE_HAS_REF_COUNT(v) { - JS_DupValueRef(v) - } else { - v - } -} - #[inline] pub unsafe fn JS_ToCString(ctx: *mut JSContext, val: JSValue) -> *const c_char { JS_ToCStringLen2(ctx, ptr::null_mut(), val, 0) @@ -159,21 +94,6 @@ pub unsafe fn JS_ToCStringLen( JS_ToCStringLen2(ctx, plen as _, val, 0) } -#[inline] -pub unsafe fn JS_GetProperty(ctx: *mut JSContext, this_obj: JSValue, prop: JSAtom) -> JSValue { - JS_GetPropertyInternal(ctx, this_obj, prop, this_obj, 0) -} - -#[inline] -pub unsafe fn JS_SetProperty( - ctx: *mut JSContext, - this_obj: JSValue, - prop: JSAtom, - val: JSValue, -) -> i32 { - JS_SetPropertyInternal(ctx, this_obj, prop, val, this_obj, JS_PROP_THROW as i32) -} - #[inline] pub fn JS_NewFloat64(d: f64) -> JSValue { union U { diff --git a/sys/src/inlines/ptr_32_nan_boxing.rs b/sys/src/inlines/ptr_32_nan_boxing.rs index 6a441706..83f2dc4b 100644 --- a/sys/src/inlines/ptr_32_nan_boxing.rs +++ b/sys/src/inlines/ptr_32_nan_boxing.rs @@ -34,7 +34,7 @@ const JS_FLOAT64_TAG_ADDEND: i32 = 0x7ff80000 - JS_TAG_FIRST + 1; #[cfg(test)] #[test] fn test_JS_FLOAT64_TAG_ADDEND() { - assert_eq!(JS_FLOAT64_TAG_ADDEND, 0x7ff8000c); + assert_eq!(JS_FLOAT64_TAG_ADDEND, 0x7ff8000a); } #[inline] @@ -56,7 +56,7 @@ pub const JS_NAN: JSValue = #[cfg(test)] #[test] fn test_JS_NAN() { - assert_eq!(JS_NAN, 0xfffffff400000000); + assert_eq!(JS_NAN, 0xfffffff600000000); } #[inline]