/rust/git/checkouts/mozjs-fa11ffc7d4f1cc2d/d90edd1/mozjs/src/rust.rs
Line | Count | Source (jump to first uncovered line) |
1 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
2 | | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
3 | | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | | |
5 | | //! Rust wrappers around the raw JS apis |
6 | | |
7 | | use std::cell::Cell; |
8 | | use std::char; |
9 | | use std::default::Default; |
10 | | use std::ffi; |
11 | | use std::ffi::CStr; |
12 | | use std::marker::PhantomData; |
13 | | use std::mem::MaybeUninit; |
14 | | use std::ops::{Deref, DerefMut}; |
15 | | use std::ptr; |
16 | | use std::slice; |
17 | | use std::str; |
18 | | use std::sync::atomic::{AtomicU32, Ordering}; |
19 | | use std::sync::{Arc, Mutex}; |
20 | | |
21 | | use crate::consts::{JSCLASS_GLOBAL_SLOT_COUNT, JSCLASS_RESERVED_SLOTS_MASK}; |
22 | | use crate::consts::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL}; |
23 | | use crate::conversions::jsstr_to_string; |
24 | | use crate::default_heapsize; |
25 | | pub use crate::gc::Traceable as Trace; |
26 | | pub use crate::gc::*; |
27 | | use crate::glue::AppendToRootedObjectVector; |
28 | | use crate::glue::{CreateRootedIdVector, CreateRootedObjectVector}; |
29 | | use crate::glue::{ |
30 | | DeleteCompileOptions, DeleteRootedObjectVector, DescribeScriptedCaller, DestroyRootedIdVector, |
31 | | }; |
32 | | use crate::glue::{ |
33 | | GetIdVectorAddress, GetObjectVectorAddress, NewCompileOptions, SliceRootedIdVector, |
34 | | }; |
35 | | use crate::jsapi; |
36 | | use crate::jsapi::glue::{DeleteRealmOptions, JS_Init, JS_NewRealmOptions}; |
37 | | use crate::jsapi::js::frontend::CompilationStencil; |
38 | | use crate::jsapi::mozilla::Utf8Unit; |
39 | | use crate::jsapi::shadow::BaseShape; |
40 | | use crate::jsapi::HandleObjectVector as RawHandleObjectVector; |
41 | | use crate::jsapi::HandleValue as RawHandleValue; |
42 | | use crate::jsapi::JS_AddExtraGCRootsTracer; |
43 | | use crate::jsapi::MutableHandleIdVector as RawMutableHandleIdVector; |
44 | | use crate::jsapi::{already_AddRefed, jsid}; |
45 | | use crate::jsapi::{BuildStackString, CaptureCurrentStack, StackFormat}; |
46 | | use crate::jsapi::{Evaluate2, HandleValueArray, StencilRelease}; |
47 | | use crate::jsapi::{InitSelfHostedCode, IsWindowSlow}; |
48 | | use crate::jsapi::{ |
49 | | JSAutoRealm, JS_SetGCParameter, JS_SetNativeStackQuota, JS_WrapObject, JS_WrapValue, |
50 | | }; |
51 | | use crate::jsapi::{JSClass, JSClassOps, JSContext, Realm, JSCLASS_RESERVED_SLOTS_SHIFT}; |
52 | | use crate::jsapi::{JSErrorReport, JSFunctionSpec, JSGCParamKey}; |
53 | | use crate::jsapi::{JSObject, JSPropertySpec, JSRuntime}; |
54 | | use crate::jsapi::{JSString, Object, PersistentRootedIdVector}; |
55 | | use crate::jsapi::{JS_DefineFunctions, JS_DefineProperties, JS_DestroyContext, JS_ShutDown}; |
56 | | use crate::jsapi::{JS_EnumerateStandardClasses, JS_GetRuntime, JS_GlobalObjectTraceHook}; |
57 | | use crate::jsapi::{JS_MayResolveStandardClass, JS_NewContext, JS_ResolveStandardClass}; |
58 | | use crate::jsapi::{JS_StackCapture_AllFrames, JS_StackCapture_MaxFrames}; |
59 | | use crate::jsapi::{PersistentRootedObjectVector, ReadOnlyCompileOptions, RootingContext}; |
60 | | use crate::jsapi::{SetWarningReporter, SourceText, ToBooleanSlow}; |
61 | | use crate::jsapi::{ToInt32Slow, ToInt64Slow, ToNumberSlow, ToStringSlow, ToUint16Slow}; |
62 | | use crate::jsapi::{ToUint32Slow, ToUint64Slow, ToWindowProxyIfWindowSlow}; |
63 | | use crate::jsval::ObjectValue; |
64 | | use crate::panic::maybe_resume_unwind; |
65 | | use lazy_static::lazy_static; |
66 | | use log::{debug, warn}; |
67 | | pub use mozjs_sys::jsgc::{GCMethods, IntoHandle, IntoMutableHandle}; |
68 | | |
69 | | use crate::rooted; |
70 | | |
71 | | // From Gecko: |
72 | | // Our "default" stack is what we use in configurations where we don't have a compelling reason to |
73 | | // do things differently. This is effectively 1MB on 64-bit platforms. |
74 | | const STACK_QUOTA: usize = 128 * 8 * 1024; |
75 | | |
76 | | // From Gecko: |
77 | | // The JS engine permits us to set different stack limits for system code, |
78 | | // trusted script, and untrusted script. We have tests that ensure that |
79 | | // we can always execute 10 "heavy" (eval+with) stack frames deeper in |
80 | | // privileged code. Our stack sizes vary greatly in different configurations, |
81 | | // so satisfying those tests requires some care. Manual measurements of the |
82 | | // number of heavy stack frames achievable gives us the following rough data, |
83 | | // ordered by the effective categories in which they are grouped in the |
84 | | // JS_SetNativeStackQuota call (which predates this analysis). |
85 | | // |
86 | | // (NB: These numbers may have drifted recently - see bug 938429) |
87 | | // OSX 64-bit Debug: 7MB stack, 636 stack frames => ~11.3k per stack frame |
88 | | // OSX64 Opt: 7MB stack, 2440 stack frames => ~3k per stack frame |
89 | | // |
90 | | // Linux 32-bit Debug: 2MB stack, 426 stack frames => ~4.8k per stack frame |
91 | | // Linux 64-bit Debug: 4MB stack, 455 stack frames => ~9.0k per stack frame |
92 | | // |
93 | | // Windows (Opt+Debug): 900K stack, 235 stack frames => ~3.4k per stack frame |
94 | | // |
95 | | // Linux 32-bit Opt: 1MB stack, 272 stack frames => ~3.8k per stack frame |
96 | | // Linux 64-bit Opt: 2MB stack, 316 stack frames => ~6.5k per stack frame |
97 | | // |
98 | | // We tune the trusted/untrusted quotas for each configuration to achieve our |
99 | | // invariants while attempting to minimize overhead. In contrast, our buffer |
100 | | // between system code and trusted script is a very unscientific 10k. |
101 | | const SYSTEM_CODE_BUFFER: usize = 10 * 1024; |
102 | | |
103 | | // Gecko's value on 64-bit. |
104 | | const TRUSTED_SCRIPT_BUFFER: usize = 8 * 12800; |
105 | | |
106 | | trait ToResult { |
107 | | fn to_result(self) -> Result<(), ()>; |
108 | | } |
109 | | |
110 | | impl ToResult for bool { |
111 | 0 | fn to_result(self) -> Result<(), ()> { |
112 | 0 | if self { |
113 | 0 | Ok(()) |
114 | | } else { |
115 | 0 | Err(()) |
116 | | } |
117 | 0 | } |
118 | | } |
119 | | |
120 | | // ___________________________________________________________________________ |
121 | | // friendly Rustic API to runtimes |
122 | | |
123 | | pub struct RealmOptions(*mut jsapi::RealmOptions); |
124 | | |
125 | | impl Deref for RealmOptions { |
126 | | type Target = jsapi::RealmOptions; |
127 | 13.1k | fn deref(&self) -> &Self::Target { |
128 | 13.1k | unsafe { &*self.0 } |
129 | 13.1k | } |
130 | | } |
131 | | |
132 | | impl DerefMut for RealmOptions { |
133 | 0 | fn deref_mut(&mut self) -> &mut Self::Target { |
134 | 0 | unsafe { &mut *self.0 } |
135 | 0 | } |
136 | | } |
137 | | |
138 | | impl Default for RealmOptions { |
139 | 13.1k | fn default() -> RealmOptions { |
140 | 13.1k | RealmOptions(unsafe { JS_NewRealmOptions() }) |
141 | 13.1k | } |
142 | | } |
143 | | |
144 | | impl Drop for RealmOptions { |
145 | 13.1k | fn drop(&mut self) { |
146 | 13.1k | unsafe { DeleteRealmOptions(self.0) } |
147 | 13.1k | } |
148 | | } |
149 | | |
150 | | thread_local!(static CONTEXT: Cell<*mut JSContext> = Cell::new(ptr::null_mut())); |
151 | | |
152 | | #[derive(PartialEq)] |
153 | | enum EngineState { |
154 | | Uninitialized, |
155 | | InitFailed, |
156 | | Initialized, |
157 | | ShutDown, |
158 | | } |
159 | | |
160 | | lazy_static! { |
161 | | static ref ENGINE_STATE: Mutex<EngineState> = Mutex::new(EngineState::Uninitialized); |
162 | | } |
163 | | |
164 | | #[derive(Debug)] |
165 | | pub enum JSEngineError { |
166 | | AlreadyInitialized, |
167 | | AlreadyShutDown, |
168 | | InitFailed, |
169 | | } |
170 | | |
171 | | /// A handle that must be kept alive in order to create new Runtimes. |
172 | | /// When this handle is dropped, the engine is shut down and cannot |
173 | | /// be reinitialized. |
174 | | pub struct JSEngine { |
175 | | /// The count of alive handles derived from this initialized instance. |
176 | | outstanding_handles: Arc<AtomicU32>, |
177 | | // Ensure this type cannot be sent between threads. |
178 | | marker: PhantomData<*mut ()>, |
179 | | } |
180 | | |
181 | | pub struct JSEngineHandle(Arc<AtomicU32>); |
182 | | |
183 | | impl Clone for JSEngineHandle { |
184 | 0 | fn clone(&self) -> JSEngineHandle { |
185 | 0 | self.0.fetch_add(1, Ordering::SeqCst); |
186 | 0 | JSEngineHandle(self.0.clone()) |
187 | 0 | } |
188 | | } |
189 | | |
190 | | impl Drop for JSEngineHandle { |
191 | 13.1k | fn drop(&mut self) { |
192 | 13.1k | self.0.fetch_sub(1, Ordering::SeqCst); |
193 | 13.1k | } |
194 | | } |
195 | | |
196 | | impl JSEngine { |
197 | | /// Initialize the JS engine to prepare for creating new JS runtimes. |
198 | 1 | pub fn init() -> Result<JSEngine, JSEngineError> { |
199 | 1 | let mut state = ENGINE_STATE.lock().unwrap(); |
200 | 1 | match *state { |
201 | 0 | EngineState::Initialized => return Err(JSEngineError::AlreadyInitialized), |
202 | 0 | EngineState::InitFailed => return Err(JSEngineError::InitFailed), |
203 | 0 | EngineState::ShutDown => return Err(JSEngineError::AlreadyShutDown), |
204 | 1 | EngineState::Uninitialized => (), |
205 | 1 | } |
206 | 1 | if unsafe { !JS_Init() } { |
207 | 0 | *state = EngineState::InitFailed; |
208 | 0 | Err(JSEngineError::InitFailed) |
209 | | } else { |
210 | 1 | *state = EngineState::Initialized; |
211 | 1 | Ok(JSEngine { |
212 | 1 | outstanding_handles: Arc::new(AtomicU32::new(0)), |
213 | 1 | marker: PhantomData, |
214 | 1 | }) |
215 | | } |
216 | 1 | } |
217 | | |
218 | 0 | pub fn can_shutdown(&self) -> bool { |
219 | 0 | self.outstanding_handles.load(Ordering::SeqCst) == 0 |
220 | 0 | } |
221 | | |
222 | | /// Create a handle to this engine. |
223 | 13.1k | pub fn handle(&self) -> JSEngineHandle { |
224 | 13.1k | self.outstanding_handles.fetch_add(1, Ordering::SeqCst); |
225 | 13.1k | JSEngineHandle(self.outstanding_handles.clone()) |
226 | 13.1k | } |
227 | | } |
228 | | |
229 | | /// Shut down the JS engine, invalidating any existing runtimes and preventing |
230 | | /// any new ones from being created. |
231 | | impl Drop for JSEngine { |
232 | 1 | fn drop(&mut self) { |
233 | 1 | let mut state = ENGINE_STATE.lock().unwrap(); |
234 | 1 | if *state == EngineState::Initialized { |
235 | 1 | assert_eq!( |
236 | 1 | self.outstanding_handles.load(Ordering::SeqCst), |
237 | | 0, |
238 | 0 | "There are outstanding JS engine handles" |
239 | | ); |
240 | 1 | *state = EngineState::ShutDown; |
241 | 1 | unsafe { |
242 | 1 | JS_ShutDown(); |
243 | 1 | } |
244 | 0 | } |
245 | 1 | } |
246 | | } |
247 | | |
248 | 26.3k | pub fn transform_str_to_source_text(source: &str) -> SourceText<Utf8Unit> { |
249 | 26.3k | SourceText { |
250 | 26.3k | units_: source.as_ptr() as *const _, |
251 | 26.3k | length_: source.len() as u32, |
252 | 26.3k | ownsUnits_: false, |
253 | 26.3k | _phantom_0: PhantomData, |
254 | 26.3k | } |
255 | 26.3k | } |
256 | | |
257 | 0 | pub fn transform_u16_to_source_text(source: &[u16]) -> SourceText<u16> { |
258 | 0 | SourceText { |
259 | 0 | units_: source.as_ptr() as *const _, |
260 | 0 | length_: source.len() as u32, |
261 | 0 | ownsUnits_: false, |
262 | 0 | _phantom_0: PhantomData, |
263 | 0 | } |
264 | 0 | } |
265 | | |
266 | | /// A handle to a Runtime that will be used to create a new runtime in another |
267 | | /// thread. This handle and the new runtime must be destroyed before the original |
268 | | /// runtime can be dropped. |
269 | | pub struct ParentRuntime { |
270 | | /// Raw pointer to the underlying SpiderMonkey runtime. |
271 | | parent: *mut JSRuntime, |
272 | | /// Handle to ensure the JS engine remains running while this handle exists. |
273 | | engine: JSEngineHandle, |
274 | | /// The number of children of the runtime that created this ParentRuntime value. |
275 | | children_of_parent: Arc<()>, |
276 | | } |
277 | | unsafe impl Send for ParentRuntime {} |
278 | | |
279 | | /// A wrapper for the `JSContext` structure in SpiderMonkey. |
280 | | pub struct Runtime { |
281 | | /// Raw pointer to the underlying SpiderMonkey context. |
282 | | cx: *mut JSContext, |
283 | | /// The engine that this runtime is associated with. |
284 | | engine: JSEngineHandle, |
285 | | /// If this Runtime was created with a parent, this member exists to ensure |
286 | | /// that that parent's count of outstanding children (see [outstanding_children]) |
287 | | /// remains accurate and will be automatically decreased when this Runtime value |
288 | | /// is dropped. |
289 | | _parent_child_count: Option<Arc<()>>, |
290 | | /// The strong references to this value represent the number of child runtimes |
291 | | /// that have been created using this Runtime as a parent. Since Runtime values |
292 | | /// must be associated with a particular thread, we cannot simply use Arc<Runtime> |
293 | | /// to represent the resulting ownership graph and risk destroying a Runtime on |
294 | | /// the wrong thread. |
295 | | outstanding_children: Arc<()>, |
296 | | } |
297 | | |
298 | | impl Runtime { |
299 | | /// Get the `JSContext` for this thread. |
300 | 0 | pub fn get() -> *mut JSContext { |
301 | 0 | let cx = CONTEXT.with(|context| context.get()); |
302 | 0 | assert!(!cx.is_null()); |
303 | 0 | cx |
304 | 0 | } |
305 | | |
306 | | /// Creates a new `JSContext`. |
307 | 13.1k | pub fn new(engine: JSEngineHandle) -> Runtime { |
308 | 13.1k | unsafe { Self::create(engine, None) } |
309 | 13.1k | } |
310 | | |
311 | | /// Signal that a new child runtime will be created in the future, and ensure |
312 | | /// that this runtime will not allow itself to be destroyed before the new |
313 | | /// child runtime. Returns a handle that can be passed to `create_with_parent` |
314 | | /// in order to create a new runtime on another thread that is associated with |
315 | | /// this runtime. |
316 | 0 | pub fn prepare_for_new_child(&self) -> ParentRuntime { |
317 | 0 | ParentRuntime { |
318 | 0 | parent: self.rt(), |
319 | 0 | engine: self.engine.clone(), |
320 | 0 | children_of_parent: self.outstanding_children.clone(), |
321 | 0 | } |
322 | 0 | } |
323 | | |
324 | | /// Creates a new `JSContext` with a parent runtime. If the parent does not outlive |
325 | | /// the new runtime, its destructor will assert. |
326 | | /// |
327 | | /// Unsafety: |
328 | | /// If panicking does not abort the program, any threads with child runtimes will |
329 | | /// continue executing after the thread with the parent runtime panics, but they |
330 | | /// will be in an invalid and undefined state. |
331 | 0 | pub unsafe fn create_with_parent(parent: ParentRuntime) -> Runtime { |
332 | 0 | Self::create(parent.engine.clone(), Some(parent)) |
333 | 0 | } |
334 | | |
335 | 13.1k | unsafe fn create(engine: JSEngineHandle, parent: Option<ParentRuntime>) -> Runtime { |
336 | 13.1k | let parent_runtime = parent.as_ref().map_or(ptr::null_mut(), |r| r.parent); |
337 | 13.1k | let js_context = JS_NewContext(default_heapsize + (ChunkSize as u32), parent_runtime); |
338 | 13.1k | assert!(!js_context.is_null()); |
339 | | |
340 | | // Unconstrain the runtime's threshold on nominal heap size, to avoid |
341 | | // triggering GC too often if operating continuously near an arbitrary |
342 | | // finite threshold. This leaves the maximum-JS_malloc-bytes threshold |
343 | | // still in effect to cause periodical, and we hope hygienic, |
344 | | // last-ditch GCs from within the GC's allocator. |
345 | 13.1k | JS_SetGCParameter(js_context, JSGCParamKey::JSGC_MAX_BYTES, u32::MAX); |
346 | 13.1k | |
347 | 13.1k | JS_AddExtraGCRootsTracer(js_context, Some(trace_traceables), ptr::null_mut()); |
348 | 13.1k | |
349 | 13.1k | JS_SetNativeStackQuota( |
350 | 13.1k | js_context, |
351 | 13.1k | STACK_QUOTA, |
352 | 13.1k | STACK_QUOTA - SYSTEM_CODE_BUFFER, |
353 | 13.1k | STACK_QUOTA - SYSTEM_CODE_BUFFER - TRUSTED_SCRIPT_BUFFER, |
354 | 13.1k | ); |
355 | 13.1k | |
356 | 13.1k | CONTEXT.with(|context| { |
357 | 13.1k | assert!(context.get().is_null()); |
358 | 13.1k | context.set(js_context); |
359 | 13.1k | }); |
360 | 13.1k | |
361 | 13.1k | #[cfg(target_pointer_width = "64")] |
362 | 13.1k | InitSelfHostedCode(js_context, [0u64; 2], None); |
363 | 13.1k | #[cfg(target_pointer_width = "32")] |
364 | 13.1k | InitSelfHostedCode(js_context, [0u32; 2], None); |
365 | 13.1k | |
366 | 13.1k | SetWarningReporter(js_context, Some(report_warning)); |
367 | 13.1k | |
368 | 13.1k | Runtime { |
369 | 13.1k | engine, |
370 | 13.1k | _parent_child_count: parent.map(|p| p.children_of_parent), |
371 | 13.1k | cx: js_context, |
372 | 13.1k | outstanding_children: Arc::new(()), |
373 | 13.1k | } |
374 | 13.1k | } |
375 | | |
376 | | /// Returns the `JSRuntime` object. |
377 | 0 | pub fn rt(&self) -> *mut JSRuntime { |
378 | 0 | unsafe { JS_GetRuntime(self.cx) } |
379 | 0 | } |
380 | | |
381 | | /// Returns the `JSContext` object. |
382 | 223k | pub fn cx(&self) -> *mut JSContext { |
383 | 223k | self.cx |
384 | 223k | } |
385 | | |
386 | 26.3k | pub fn evaluate_script( |
387 | 26.3k | &self, |
388 | 26.3k | glob: HandleObject, |
389 | 26.3k | script: &str, |
390 | 26.3k | filename: &str, |
391 | 26.3k | line_num: u32, |
392 | 26.3k | rval: MutableHandleValue, |
393 | 26.3k | ) -> Result<(), ()> { |
394 | 26.3k | debug!( |
395 | 0 | "Evaluating script from {} with content {}", |
396 | | filename, script |
397 | | ); |
398 | | |
399 | 26.3k | let _ac = JSAutoRealm::new(self.cx(), glob.get()); |
400 | 26.3k | let options = unsafe { CompileOptionsWrapper::new(self.cx(), filename, line_num) }; |
401 | 26.3k | |
402 | 26.3k | unsafe { |
403 | 26.3k | let mut source = transform_str_to_source_text(&script); |
404 | 26.3k | if !Evaluate2(self.cx(), options.ptr, &mut source, rval.into()) { |
405 | 0 | debug!("...err!"); |
406 | 0 | maybe_resume_unwind(); |
407 | 0 | Err(()) |
408 | | } else { |
409 | | // we could return the script result but then we'd have |
410 | | // to root it and so forth and, really, who cares? |
411 | 26.3k | debug!("...ok!"); |
412 | 26.3k | Ok(()) |
413 | | } |
414 | | } |
415 | 26.3k | } |
416 | | } |
417 | | |
418 | | impl Drop for Runtime { |
419 | 13.1k | fn drop(&mut self) { |
420 | 13.1k | assert_eq!( |
421 | 13.1k | Arc::strong_count(&self.outstanding_children), |
422 | | 1, |
423 | 0 | "This runtime still has live children." |
424 | | ); |
425 | 13.1k | unsafe { |
426 | 13.1k | JS_DestroyContext(self.cx); |
427 | 13.1k | |
428 | 13.1k | CONTEXT.with(|context| { |
429 | 13.1k | assert_eq!(context.get(), self.cx); |
430 | 13.1k | context.set(ptr::null_mut()); |
431 | 13.1k | }); |
432 | 13.1k | } |
433 | 13.1k | } |
434 | | } |
435 | | |
436 | | const ChunkShift: usize = 20; |
437 | | const ChunkSize: usize = 1 << ChunkShift; |
438 | | |
439 | | #[cfg(target_pointer_width = "32")] |
440 | | const ChunkLocationOffset: usize = ChunkSize - 2 * 4 - 8; |
441 | | |
442 | | // ___________________________________________________________________________ |
443 | | // Wrappers around things in jsglue.cpp |
444 | | |
445 | | pub struct RootedObjectVectorWrapper { |
446 | | pub ptr: *mut PersistentRootedObjectVector, |
447 | | } |
448 | | |
449 | | impl RootedObjectVectorWrapper { |
450 | 0 | pub fn new(cx: *mut JSContext) -> RootedObjectVectorWrapper { |
451 | 0 | RootedObjectVectorWrapper { |
452 | 0 | ptr: unsafe { CreateRootedObjectVector(cx) }, |
453 | 0 | } |
454 | 0 | } |
455 | | |
456 | 0 | pub fn append(&self, obj: *mut JSObject) -> bool { |
457 | 0 | unsafe { AppendToRootedObjectVector(self.ptr, obj) } |
458 | 0 | } |
459 | | |
460 | 0 | pub fn handle(&self) -> RawHandleObjectVector { |
461 | 0 | RawHandleObjectVector { |
462 | 0 | ptr: unsafe { GetObjectVectorAddress(self.ptr) }, |
463 | 0 | } |
464 | 0 | } |
465 | | } |
466 | | |
467 | | impl Drop for RootedObjectVectorWrapper { |
468 | 0 | fn drop(&mut self) { |
469 | 0 | unsafe { DeleteRootedObjectVector(self.ptr) } |
470 | 0 | } |
471 | | } |
472 | | |
473 | | pub struct CompileOptionsWrapper { |
474 | | pub ptr: *mut ReadOnlyCompileOptions, |
475 | | } |
476 | | |
477 | | impl CompileOptionsWrapper { |
478 | 26.3k | pub unsafe fn new(cx: *mut JSContext, filename: &str, line: u32) -> Self { |
479 | 26.3k | let filename_cstr = ffi::CString::new(filename.as_bytes()).unwrap(); |
480 | 26.3k | let ptr = NewCompileOptions(cx, filename_cstr.as_ptr(), line); |
481 | 26.3k | assert!(!ptr.is_null()); |
482 | 26.3k | Self { ptr } |
483 | 26.3k | } |
484 | | } |
485 | | |
486 | | impl Drop for CompileOptionsWrapper { |
487 | 26.3k | fn drop(&mut self) { |
488 | 26.3k | unsafe { DeleteCompileOptions(self.ptr) } |
489 | 26.3k | } |
490 | | } |
491 | | |
492 | | pub struct Stencil { |
493 | | inner: already_AddRefed<CompilationStencil>, |
494 | | } |
495 | | |
496 | | /*unsafe impl Send for Stencil {} |
497 | | unsafe impl Sync for Stencil {}*/ |
498 | | |
499 | | impl Drop for Stencil { |
500 | 0 | fn drop(&mut self) { |
501 | 0 | if self.is_null() { |
502 | 0 | return; |
503 | 0 | } |
504 | 0 | unsafe { |
505 | 0 | StencilRelease(self.inner.mRawPtr); |
506 | 0 | } |
507 | 0 | } |
508 | | } |
509 | | |
510 | | impl Deref for Stencil { |
511 | | type Target = *mut CompilationStencil; |
512 | | |
513 | 0 | fn deref(&self) -> &Self::Target { |
514 | 0 | &self.inner.mRawPtr |
515 | 0 | } |
516 | | } |
517 | | |
518 | | impl Stencil { |
519 | 0 | pub fn is_null(&self) -> bool { |
520 | 0 | self.inner.mRawPtr.is_null() |
521 | 0 | } |
522 | | } |
523 | | |
524 | | // ___________________________________________________________________________ |
525 | | // Fast inline converters |
526 | | |
527 | | #[inline] |
528 | 0 | pub unsafe fn ToBoolean(v: HandleValue) -> bool { |
529 | 0 | let val = *v.ptr; |
530 | 0 |
|
531 | 0 | if val.is_boolean() { |
532 | 0 | return val.to_boolean(); |
533 | 0 | } |
534 | 0 |
|
535 | 0 | if val.is_int32() { |
536 | 0 | return val.to_int32() != 0; |
537 | 0 | } |
538 | 0 |
|
539 | 0 | if val.is_null_or_undefined() { |
540 | 0 | return false; |
541 | 0 | } |
542 | 0 |
|
543 | 0 | if val.is_double() { |
544 | 0 | let d = val.to_double(); |
545 | 0 | return !d.is_nan() && d != 0f64; |
546 | 0 | } |
547 | 0 |
|
548 | 0 | if val.is_symbol() { |
549 | 0 | return true; |
550 | 0 | } |
551 | 0 |
|
552 | 0 | ToBooleanSlow(v.into()) |
553 | 0 | } |
554 | | |
555 | | #[inline] |
556 | 0 | pub unsafe fn ToNumber(cx: *mut JSContext, v: HandleValue) -> Result<f64, ()> { |
557 | 0 | let val = *v.ptr; |
558 | 0 | if val.is_number() { |
559 | 0 | return Ok(val.to_number()); |
560 | 0 | } |
561 | 0 |
|
562 | 0 | let mut out = Default::default(); |
563 | 0 | if ToNumberSlow(cx, v.into_handle(), &mut out) { |
564 | 0 | Ok(out) |
565 | | } else { |
566 | 0 | Err(()) |
567 | | } |
568 | 0 | } |
569 | | |
570 | | #[inline] |
571 | 0 | unsafe fn convert_from_int32<T: Default + Copy>( |
572 | 0 | cx: *mut JSContext, |
573 | 0 | v: HandleValue, |
574 | 0 | conv_fn: unsafe extern "C" fn(*mut JSContext, RawHandleValue, *mut T) -> bool, |
575 | 0 | ) -> Result<T, ()> { |
576 | 0 | let val = *v.ptr; |
577 | 0 | if val.is_int32() { |
578 | 0 | let intval: i64 = val.to_int32() as i64; |
579 | 0 | // TODO: do something better here that works on big endian |
580 | 0 | let intval = *(&intval as *const i64 as *const T); |
581 | 0 | return Ok(intval); |
582 | 0 | } |
583 | 0 |
|
584 | 0 | let mut out = Default::default(); |
585 | 0 | if conv_fn(cx, v.into(), &mut out) { |
586 | 0 | Ok(out) |
587 | | } else { |
588 | 0 | Err(()) |
589 | | } |
590 | 0 | } Unexecuted instantiation: mozjs::rust::convert_from_int32::<i32> Unexecuted instantiation: mozjs::rust::convert_from_int32::<u32> Unexecuted instantiation: mozjs::rust::convert_from_int32::<u16> Unexecuted instantiation: mozjs::rust::convert_from_int32::<i64> Unexecuted instantiation: mozjs::rust::convert_from_int32::<u64> |
591 | | |
592 | | #[inline] |
593 | 0 | pub unsafe fn ToInt32(cx: *mut JSContext, v: HandleValue) -> Result<i32, ()> { |
594 | 0 | convert_from_int32::<i32>(cx, v, ToInt32Slow) |
595 | 0 | } |
596 | | |
597 | | #[inline] |
598 | 0 | pub unsafe fn ToUint32(cx: *mut JSContext, v: HandleValue) -> Result<u32, ()> { |
599 | 0 | convert_from_int32::<u32>(cx, v, ToUint32Slow) |
600 | 0 | } |
601 | | |
602 | | #[inline] |
603 | 0 | pub unsafe fn ToUint16(cx: *mut JSContext, v: HandleValue) -> Result<u16, ()> { |
604 | 0 | convert_from_int32::<u16>(cx, v, ToUint16Slow) |
605 | 0 | } |
606 | | |
607 | | #[inline] |
608 | 0 | pub unsafe fn ToInt64(cx: *mut JSContext, v: HandleValue) -> Result<i64, ()> { |
609 | 0 | convert_from_int32::<i64>(cx, v, ToInt64Slow) |
610 | 0 | } |
611 | | |
612 | | #[inline] |
613 | 0 | pub unsafe fn ToUint64(cx: *mut JSContext, v: HandleValue) -> Result<u64, ()> { |
614 | 0 | convert_from_int32::<u64>(cx, v, ToUint64Slow) |
615 | 0 | } |
616 | | |
617 | | #[inline] |
618 | 0 | pub unsafe fn ToString(cx: *mut JSContext, v: HandleValue) -> *mut JSString { |
619 | 0 | let val = *v.ptr; |
620 | 0 | if val.is_string() { |
621 | 0 | return val.to_string(); |
622 | 0 | } |
623 | 0 |
|
624 | 0 | ToStringSlow(cx, v.into()) |
625 | 0 | } |
626 | | |
627 | 0 | pub unsafe fn ToWindowProxyIfWindow(obj: *mut JSObject) -> *mut JSObject { |
628 | 0 | if is_window(obj) { |
629 | 0 | ToWindowProxyIfWindowSlow(obj) |
630 | | } else { |
631 | 0 | obj |
632 | | } |
633 | 0 | } |
634 | | |
635 | 0 | pub unsafe extern "C" fn report_warning(_cx: *mut JSContext, report: *mut JSErrorReport) { |
636 | 0 | fn latin1_to_string(bytes: &[u8]) -> String { |
637 | 0 | bytes |
638 | 0 | .iter() |
639 | 0 | .map(|c| char::from_u32(*c as u32).unwrap()) |
640 | 0 | .collect() |
641 | 0 | } |
642 | | |
643 | 0 | let fnptr = (*report)._base.filename.data_; |
644 | 0 | let fname = if !fnptr.is_null() { |
645 | 0 | let c_str = CStr::from_ptr(fnptr); |
646 | 0 | latin1_to_string(c_str.to_bytes()) |
647 | | } else { |
648 | 0 | "none".to_string() |
649 | | }; |
650 | | |
651 | 0 | let lineno = (*report)._base.lineno; |
652 | 0 | let column = (*report)._base.column._base; |
653 | 0 |
|
654 | 0 | let msg_ptr = (*report)._base.message_.data_ as *const u8; |
655 | 0 | let msg_len = (0usize..) |
656 | 0 | .find(|&i| *msg_ptr.offset(i as isize) == 0) |
657 | 0 | .unwrap(); |
658 | 0 | let msg_slice = slice::from_raw_parts(msg_ptr, msg_len); |
659 | 0 | let msg = str::from_utf8_unchecked(msg_slice); |
660 | 0 |
|
661 | 0 | warn!("Warning at {}:{}:{}: {}\n", fname, lineno, column, msg); |
662 | 0 | } |
663 | | |
664 | | pub struct IdVector(*mut PersistentRootedIdVector); |
665 | | |
666 | | impl IdVector { |
667 | 0 | pub unsafe fn new(cx: *mut JSContext) -> IdVector { |
668 | 0 | let vector = CreateRootedIdVector(cx); |
669 | 0 | assert!(!vector.is_null()); |
670 | 0 | IdVector(vector) |
671 | 0 | } |
672 | | |
673 | 0 | pub fn handle_mut(&mut self) -> RawMutableHandleIdVector { |
674 | 0 | RawMutableHandleIdVector { |
675 | 0 | ptr: unsafe { GetIdVectorAddress(self.0) }, |
676 | 0 | } |
677 | 0 | } |
678 | | } |
679 | | |
680 | | impl Drop for IdVector { |
681 | 0 | fn drop(&mut self) { |
682 | 0 | unsafe { DestroyRootedIdVector(self.0) } |
683 | 0 | } |
684 | | } |
685 | | |
686 | | impl Deref for IdVector { |
687 | | type Target = [jsid]; |
688 | | |
689 | 0 | fn deref(&self) -> &[jsid] { |
690 | 0 | unsafe { |
691 | 0 | let mut length = 0; |
692 | 0 | let pointer = SliceRootedIdVector(self.0, &mut length); |
693 | 0 | slice::from_raw_parts(pointer, length) |
694 | 0 | } |
695 | 0 | } |
696 | | } |
697 | | |
698 | | /// Defines methods on `obj`. The last entry of `methods` must contain zeroed |
699 | | /// memory. |
700 | | /// |
701 | | /// # Failures |
702 | | /// |
703 | | /// Returns `Err` on JSAPI failure. |
704 | | /// |
705 | | /// # Panics |
706 | | /// |
707 | | /// Panics if the last entry of `methods` does not contain zeroed memory. |
708 | | /// |
709 | | /// # Safety |
710 | | /// |
711 | | /// - `cx` must be valid. |
712 | | /// - This function calls into unaudited C++ code. |
713 | 0 | pub unsafe fn define_methods( |
714 | 0 | cx: *mut JSContext, |
715 | 0 | obj: HandleObject, |
716 | 0 | methods: &'static [JSFunctionSpec], |
717 | 0 | ) -> Result<(), ()> { |
718 | 0 | assert!({ |
719 | 0 | match methods.last() { |
720 | | Some(&JSFunctionSpec { |
721 | 0 | name, |
722 | 0 | call, |
723 | 0 | nargs, |
724 | 0 | flags, |
725 | 0 | selfHostedName, |
726 | 0 | }) => { |
727 | 0 | name.string_.is_null() |
728 | 0 | && call.is_zeroed() |
729 | 0 | && nargs == 0 |
730 | 0 | && flags == 0 |
731 | 0 | && selfHostedName.is_null() |
732 | | } |
733 | 0 | None => false, |
734 | | } |
735 | | }); |
736 | | |
737 | 0 | JS_DefineFunctions(cx, obj.into(), methods.as_ptr()).to_result() |
738 | 0 | } |
739 | | |
740 | | /// Defines attributes on `obj`. The last entry of `properties` must contain |
741 | | /// zeroed memory. |
742 | | /// |
743 | | /// # Failures |
744 | | /// |
745 | | /// Returns `Err` on JSAPI failure. |
746 | | /// |
747 | | /// # Panics |
748 | | /// |
749 | | /// Panics if the last entry of `properties` does not contain zeroed memory. |
750 | | /// |
751 | | /// # Safety |
752 | | /// |
753 | | /// - `cx` must be valid. |
754 | | /// - This function calls into unaudited C++ code. |
755 | 0 | pub unsafe fn define_properties( |
756 | 0 | cx: *mut JSContext, |
757 | 0 | obj: HandleObject, |
758 | 0 | properties: &'static [JSPropertySpec], |
759 | 0 | ) -> Result<(), ()> { |
760 | 0 | assert!({ |
761 | 0 | match properties.last() { |
762 | 0 | Some(spec) => spec.is_zeroed(), |
763 | 0 | None => false, |
764 | | } |
765 | | }); |
766 | | |
767 | 0 | JS_DefineProperties(cx, obj.into(), properties.as_ptr()).to_result() |
768 | 0 | } |
769 | | |
770 | | static SIMPLE_GLOBAL_CLASS_OPS: JSClassOps = JSClassOps { |
771 | | addProperty: None, |
772 | | delProperty: None, |
773 | | enumerate: Some(JS_EnumerateStandardClasses), |
774 | | newEnumerate: None, |
775 | | resolve: Some(JS_ResolveStandardClass), |
776 | | mayResolve: Some(JS_MayResolveStandardClass), |
777 | | finalize: None, |
778 | | call: None, |
779 | | construct: None, |
780 | | trace: Some(JS_GlobalObjectTraceHook), |
781 | | }; |
782 | | |
783 | | /// This is a simple `JSClass` for global objects, primarily intended for tests. |
784 | | pub static SIMPLE_GLOBAL_CLASS: JSClass = JSClass { |
785 | | name: b"Global\0" as *const u8 as *const _, |
786 | | flags: JSCLASS_IS_GLOBAL |
787 | | | ((JSCLASS_GLOBAL_SLOT_COUNT & JSCLASS_RESERVED_SLOTS_MASK) |
788 | | << JSCLASS_RESERVED_SLOTS_SHIFT), |
789 | | cOps: &SIMPLE_GLOBAL_CLASS_OPS as *const JSClassOps, |
790 | | spec: ptr::null(), |
791 | | ext: ptr::null(), |
792 | | oOps: ptr::null(), |
793 | | }; |
794 | | |
795 | | #[inline] |
796 | 0 | unsafe fn get_object_group(obj: *mut JSObject) -> *mut BaseShape { |
797 | 0 | assert!(!obj.is_null()); |
798 | 0 | let obj = obj as *mut Object; |
799 | 0 | (*(*obj).shape).base |
800 | 0 | } |
801 | | |
802 | | #[inline] |
803 | 0 | pub unsafe fn get_object_class(obj: *mut JSObject) -> *const JSClass { |
804 | 0 | (*get_object_group(obj)).clasp as *const _ |
805 | 0 | } |
806 | | |
807 | | #[inline] |
808 | 0 | pub unsafe fn get_object_realm(obj: *mut JSObject) -> *mut Realm { |
809 | 0 | (*get_object_group(obj)).realm |
810 | 0 | } |
811 | | |
812 | | #[inline] |
813 | 0 | pub unsafe fn get_context_realm(cx: *mut JSContext) -> *mut Realm { |
814 | 0 | let cx = cx as *mut RootingContext; |
815 | 0 | (*cx).realm_ |
816 | 0 | } |
817 | | |
818 | | #[inline] |
819 | 0 | pub fn is_dom_class(class: &JSClass) -> bool { |
820 | 0 | class.flags & JSCLASS_IS_DOMJSCLASS != 0 |
821 | 0 | } |
822 | | |
823 | | #[inline] |
824 | 0 | pub unsafe fn is_dom_object(obj: *mut JSObject) -> bool { |
825 | 0 | is_dom_class(&*get_object_class(obj)) |
826 | 0 | } |
827 | | |
828 | | #[inline] |
829 | 0 | pub unsafe fn is_window(obj: *mut JSObject) -> bool { |
830 | 0 | (*get_object_class(obj)).flags & JSCLASS_IS_GLOBAL != 0 && IsWindowSlow(obj) |
831 | 0 | } |
832 | | |
833 | | #[inline] |
834 | 0 | pub unsafe fn try_to_outerize(mut rval: MutableHandleValue) { |
835 | 0 | let obj = rval.to_object(); |
836 | 0 | if is_window(obj) { |
837 | 0 | let obj = ToWindowProxyIfWindowSlow(obj); |
838 | 0 | assert!(!obj.is_null()); |
839 | 0 | rval.set(ObjectValue(&mut *obj)); |
840 | 0 | } |
841 | 0 | } |
842 | | |
843 | | #[inline] |
844 | 0 | pub unsafe fn try_to_outerize_object(mut rval: MutableHandleObject) { |
845 | 0 | if is_window(*rval) { |
846 | 0 | let obj = ToWindowProxyIfWindowSlow(*rval); |
847 | 0 | assert!(!obj.is_null()); |
848 | 0 | rval.set(obj); |
849 | 0 | } |
850 | 0 | } |
851 | | |
852 | | #[inline] |
853 | 0 | pub unsafe fn maybe_wrap_object(cx: *mut JSContext, obj: MutableHandleObject) { |
854 | 0 | if get_object_realm(*obj) != get_context_realm(cx) { |
855 | 0 | assert!(JS_WrapObject(cx, obj.into())); |
856 | 0 | } |
857 | 0 | try_to_outerize_object(obj); |
858 | 0 | } |
859 | | |
860 | | #[inline] |
861 | 0 | pub unsafe fn maybe_wrap_object_value(cx: *mut JSContext, rval: MutableHandleValue) { |
862 | 0 | assert!(rval.is_object()); |
863 | 0 | let obj = rval.to_object(); |
864 | 0 | if get_object_realm(obj) != get_context_realm(cx) { |
865 | 0 | assert!(JS_WrapValue(cx, rval.into())); |
866 | 0 | } else if is_dom_object(obj) { |
867 | 0 | try_to_outerize(rval); |
868 | 0 | } |
869 | 0 | } |
870 | | |
871 | | #[inline] |
872 | 0 | pub unsafe fn maybe_wrap_object_or_null_value(cx: *mut JSContext, rval: MutableHandleValue) { |
873 | 0 | assert!(rval.is_object_or_null()); |
874 | 0 | if !rval.is_null() { |
875 | 0 | maybe_wrap_object_value(cx, rval); |
876 | 0 | } |
877 | 0 | } |
878 | | |
879 | | #[inline] |
880 | 0 | pub unsafe fn maybe_wrap_value(cx: *mut JSContext, rval: MutableHandleValue) { |
881 | 0 | if rval.is_string() { |
882 | 0 | assert!(JS_WrapValue(cx, rval.into())); |
883 | 0 | } else if rval.is_object() { |
884 | 0 | maybe_wrap_object_value(cx, rval); |
885 | 0 | } |
886 | 0 | } |
887 | | |
888 | | /// Like `JSJitInfo::new_bitfield_1`, but usable in `const` contexts. |
889 | | #[macro_export] |
890 | | macro_rules! new_jsjitinfo_bitfield_1 { |
891 | | ( |
892 | | $type_: expr, |
893 | | $aliasSet_: expr, |
894 | | $returnType_: expr, |
895 | | $isInfallible: expr, |
896 | | $isMovable: expr, |
897 | | $isEliminatable: expr, |
898 | | $isAlwaysInSlot: expr, |
899 | | $isLazilyCachedInSlot: expr, |
900 | | $isTypedMethod: expr, |
901 | | $slotIndex: expr, |
902 | | ) => { |
903 | | 0 | (($type_ as u32) << 0u32) |
904 | | | (($aliasSet_ as u32) << 4u32) |
905 | | | (($returnType_ as u32) << 8u32) |
906 | | | (($isInfallible as u32) << 16u32) |
907 | | | (($isMovable as u32) << 17u32) |
908 | | | (($isEliminatable as u32) << 18u32) |
909 | | | (($isAlwaysInSlot as u32) << 19u32) |
910 | | | (($isLazilyCachedInSlot as u32) << 20u32) |
911 | | | (($isTypedMethod as u32) << 21u32) |
912 | | | (($slotIndex as u32) << 22u32) |
913 | | }; |
914 | | } |
915 | | |
916 | | #[derive(Debug, Default)] |
917 | | pub struct ScriptedCaller { |
918 | | pub filename: String, |
919 | | pub line: u32, |
920 | | pub col: u32, |
921 | | } |
922 | | |
923 | 0 | pub unsafe fn describe_scripted_caller(cx: *mut JSContext) -> Result<ScriptedCaller, ()> { |
924 | 0 | let mut buf = [0; 1024]; |
925 | 0 | let mut line = 0; |
926 | 0 | let mut col = 0; |
927 | 0 | if !DescribeScriptedCaller(cx, buf.as_mut_ptr(), buf.len(), &mut line, &mut col) { |
928 | 0 | return Err(()); |
929 | 0 | } |
930 | 0 | let filename = CStr::from_ptr((&buf) as *const _ as *const _); |
931 | 0 | Ok(ScriptedCaller { |
932 | 0 | filename: String::from_utf8_lossy(filename.to_bytes()).into_owned(), |
933 | 0 | line, |
934 | 0 | col, |
935 | 0 | }) |
936 | 0 | } |
937 | | |
938 | | pub struct CapturedJSStack<'a> { |
939 | | cx: *mut JSContext, |
940 | | stack: RootedGuard<'a, *mut JSObject>, |
941 | | } |
942 | | |
943 | | impl<'a> CapturedJSStack<'a> { |
944 | 0 | pub unsafe fn new( |
945 | 0 | cx: *mut JSContext, |
946 | 0 | mut guard: RootedGuard<'a, *mut JSObject>, |
947 | 0 | max_frame_count: Option<u32>, |
948 | 0 | ) -> Option<Self> { |
949 | 0 | let ref mut stack_capture = MaybeUninit::uninit(); |
950 | 0 | match max_frame_count { |
951 | 0 | None => JS_StackCapture_AllFrames(stack_capture.as_mut_ptr()), |
952 | 0 | Some(count) => JS_StackCapture_MaxFrames(count, stack_capture.as_mut_ptr()), |
953 | | }; |
954 | 0 | let ref mut stack_capture = stack_capture.assume_init(); |
955 | 0 |
|
956 | 0 | if !CaptureCurrentStack(cx, guard.handle_mut().raw(), stack_capture) { |
957 | 0 | None |
958 | | } else { |
959 | 0 | Some(CapturedJSStack { cx, stack: guard }) |
960 | | } |
961 | 0 | } |
962 | | |
963 | 0 | pub fn as_string(&self, indent: Option<usize>, format: StackFormat) -> Option<String> { |
964 | 0 | unsafe { |
965 | 0 | let stack_handle = self.stack.handle(); |
966 | 0 | rooted!(in(self.cx) let mut js_string = ptr::null_mut::<JSString>()); |
967 | 0 | let mut string_handle = js_string.handle_mut(); |
968 | 0 |
|
969 | 0 | if !BuildStackString( |
970 | 0 | self.cx, |
971 | 0 | ptr::null_mut(), |
972 | 0 | stack_handle.into(), |
973 | 0 | string_handle.raw(), |
974 | 0 | indent.unwrap_or(0), |
975 | 0 | format, |
976 | 0 | ) { |
977 | 0 | return None; |
978 | 0 | } |
979 | 0 |
|
980 | 0 | Some(jsstr_to_string(self.cx, string_handle.get())) |
981 | | } |
982 | 0 | } |
983 | | } |
984 | | |
985 | | #[macro_export] |
986 | | macro_rules! capture_stack { |
987 | | (in($cx:expr) let $name:ident = with max depth($max_frame_count:expr)) => { |
988 | | rooted!(in($cx) let mut __obj = ::std::ptr::null_mut()); |
989 | | let $name = $crate::rust::CapturedJSStack::new($cx, __obj, Some($max_frame_count)); |
990 | | }; |
991 | | (in($cx:expr) let $name:ident ) => { |
992 | | rooted!(in($cx) let mut __obj = ::std::ptr::null_mut()); |
993 | | let $name = $crate::rust::CapturedJSStack::new($cx, __obj, None); |
994 | | } |
995 | | } |
996 | | |
997 | | /** Wrappers for JSAPI methods that should NOT be used. |
998 | | * |
999 | | * The wrapped methods are identical except that they accept Handle and MutableHandle arguments |
1000 | | * that include lifetimes instead. |
1001 | | * |
1002 | | * They require MutableHandles to implement Copy. All code should migrate to jsapi_wrapped instead. |
1003 | | * */ |
1004 | | pub mod wrappers { |
1005 | | macro_rules! wrap { |
1006 | | // The invocation of @inner has the following form: |
1007 | | // @inner (input args) <> (accumulator) <> unparsed tokens |
1008 | | // when `unparsed tokens == \eps`, accumulator contains the final result |
1009 | | |
1010 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: Handle<$gentype:ty>, $($rest:tt)*) => { |
1011 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1012 | | }; |
1013 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: MutableHandle<$gentype:ty>, $($rest:tt)*) => { |
1014 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1015 | | }; |
1016 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: Handle, $($rest:tt)*) => { |
1017 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1018 | | }; |
1019 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: MutableHandle, $($rest:tt)*) => { |
1020 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1021 | | }; |
1022 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: HandleFunction , $($rest:tt)*) => { |
1023 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1024 | | }; |
1025 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: HandleId , $($rest:tt)*) => { |
1026 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1027 | | }; |
1028 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: HandleObject , $($rest:tt)*) => { |
1029 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1030 | | }; |
1031 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: HandleScript , $($rest:tt)*) => { |
1032 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1033 | | }; |
1034 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: HandleString , $($rest:tt)*) => { |
1035 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1036 | | }; |
1037 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: HandleSymbol , $($rest:tt)*) => { |
1038 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1039 | | }; |
1040 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: HandleValue , $($rest:tt)*) => { |
1041 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1042 | | }; |
1043 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: MutableHandleFunction , $($rest:tt)*) => { |
1044 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1045 | | }; |
1046 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: MutableHandleId , $($rest:tt)*) => { |
1047 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1048 | | }; |
1049 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: MutableHandleObject , $($rest:tt)*) => { |
1050 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1051 | | }; |
1052 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: MutableHandleScript , $($rest:tt)*) => { |
1053 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1054 | | }; |
1055 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: MutableHandleString , $($rest:tt)*) => { |
1056 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1057 | | }; |
1058 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: MutableHandleSymbol , $($rest:tt)*) => { |
1059 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1060 | | }; |
1061 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: MutableHandleValue , $($rest:tt)*) => { |
1062 | | wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1063 | | }; |
1064 | | (@inner $saved:tt <> ($($acc:expr,)*) <> $arg:ident: $type:ty, $($rest:tt)*) => { |
1065 | | wrap!(@inner $saved <> ($($acc,)* $arg,) <> $($rest)*); |
1066 | | }; |
1067 | | (@inner ($module:tt: $func_name:ident ($($args:tt)*) -> $outtype:ty) <> ($($argexprs:expr,)*) <> ) => { |
1068 | | #[inline] |
1069 | 13.1k | pub unsafe fn $func_name($($args)*) -> $outtype { |
1070 | 13.1k | $module::$func_name($($argexprs),*) |
1071 | 13.1k | } mozjs::rust::wrappers::JS_CallFunctionName Line | Count | Source | 1069 | 13.1k | pub unsafe fn $func_name($($args)*) -> $outtype { | 1070 | 13.1k | $module::$func_name($($argexprs),*) | 1071 | 13.1k | } |
Unexecuted instantiation: mozjs::rust::wrappers::ToBooleanSlow Unexecuted instantiation: mozjs::rust::wrappers::ToNumberSlow Unexecuted instantiation: mozjs::rust::wrappers::ToInt8Slow Unexecuted instantiation: mozjs::rust::wrappers::ToUint8Slow Unexecuted instantiation: mozjs::rust::wrappers::ToInt16Slow Unexecuted instantiation: mozjs::rust::wrappers::ToInt32Slow Unexecuted instantiation: mozjs::rust::wrappers::ToUint32Slow Unexecuted instantiation: mozjs::rust::wrappers::ToUint16Slow Unexecuted instantiation: mozjs::rust::wrappers::ToInt64Slow Unexecuted instantiation: mozjs::rust::wrappers::ToUint64Slow Unexecuted instantiation: mozjs::rust::wrappers::ToStringSlow Unexecuted instantiation: mozjs::rust::wrappers::ToObjectSlow Unexecuted instantiation: mozjs::rust::wrappers::NukeNonCCWProxy Unexecuted instantiation: mozjs::rust::wrappers::GetFirstSubsumedSavedFrame Unexecuted instantiation: mozjs::rust::wrappers::TransparentObjectWrapper Unexecuted instantiation: mozjs::rust::wrappers::UnwrapOneCheckedDynamic Unexecuted instantiation: mozjs::rust::wrappers::RemapDeadWrapper Unexecuted instantiation: mozjs::rust::wrappers::RemapAllWrappersForObject Unexecuted instantiation: mozjs::rust::wrappers::SetWindowProxy Unexecuted instantiation: mozjs::rust::wrappers::IsArgumentsObject Unexecuted instantiation: mozjs::rust::wrappers::EnqueueJob Unexecuted instantiation: mozjs::rust::wrappers::AssertSameCompartment1 Unexecuted instantiation: mozjs::rust::wrappers::NewFunctionByIdWithReservedAndProto Unexecuted instantiation: mozjs::rust::wrappers::GetObjectProto Unexecuted instantiation: mozjs::rust::wrappers::GetRealmOriginalEval Unexecuted instantiation: mozjs::rust::wrappers::GetPropertyKeys Unexecuted instantiation: mozjs::rust::wrappers::DateIsValid Unexecuted instantiation: mozjs::rust::wrappers::DateGetMsecSinceEpoch Unexecuted instantiation: mozjs::rust::wrappers::PrepareScriptEnvironmentAndInvoke Unexecuted instantiation: mozjs::rust::wrappers::GetElementsWithAdder Unexecuted instantiation: mozjs::rust::wrappers::ExecuteInFrameScriptEnvironment Unexecuted instantiation: mozjs::rust::wrappers::ReportIsNotFunction Unexecuted instantiation: mozjs::rust::wrappers::RemapRemoteWindowProxies Unexecuted instantiation: mozjs::rust::wrappers::ComputeThis Unexecuted instantiation: mozjs::rust::wrappers::MaybeFreezeCtorAndPrototype Unexecuted instantiation: mozjs::rust::wrappers::GetFunctionRealm Unexecuted instantiation: mozjs::rust::wrappers::CaptureCurrentStack Unexecuted instantiation: mozjs::rust::wrappers::BuildStackString Unexecuted instantiation: mozjs::rust::wrappers::Call Unexecuted instantiation: mozjs::rust::wrappers::Construct Unexecuted instantiation: mozjs::rust::wrappers::Construct1 Unexecuted instantiation: mozjs::rust::wrappers::ToGetterId Unexecuted instantiation: mozjs::rust::wrappers::ToSetterId Unexecuted instantiation: mozjs::rust::wrappers::ExceptionStackOrNull Unexecuted instantiation: mozjs::rust::wrappers::MapSize Unexecuted instantiation: mozjs::rust::wrappers::MapGet Unexecuted instantiation: mozjs::rust::wrappers::MapHas Unexecuted instantiation: mozjs::rust::wrappers::MapSet Unexecuted instantiation: mozjs::rust::wrappers::MapDelete Unexecuted instantiation: mozjs::rust::wrappers::MapClear Unexecuted instantiation: mozjs::rust::wrappers::MapKeys Unexecuted instantiation: mozjs::rust::wrappers::MapValues Unexecuted instantiation: mozjs::rust::wrappers::MapEntries Unexecuted instantiation: mozjs::rust::wrappers::MapForEach Unexecuted instantiation: mozjs::rust::wrappers::SetSize Unexecuted instantiation: mozjs::rust::wrappers::SetHas Unexecuted instantiation: mozjs::rust::wrappers::SetDelete Unexecuted instantiation: mozjs::rust::wrappers::SetAdd Unexecuted instantiation: mozjs::rust::wrappers::SetClear Unexecuted instantiation: mozjs::rust::wrappers::SetKeys Unexecuted instantiation: mozjs::rust::wrappers::SetValues Unexecuted instantiation: mozjs::rust::wrappers::SetEntries Unexecuted instantiation: mozjs::rust::wrappers::SetForEach Unexecuted instantiation: mozjs::rust::wrappers::ToCompletePropertyDescriptor Unexecuted instantiation: mozjs::rust::wrappers::NewSymbol Unexecuted instantiation: mozjs::rust::wrappers::GetSymbolFor Unexecuted instantiation: mozjs::rust::wrappers::GetSymbolDescription Unexecuted instantiation: mozjs::rust::wrappers::GetSymbolCode Unexecuted instantiation: mozjs::rust::wrappers::AbortIncrementalEncoding Unexecuted instantiation: mozjs::rust::wrappers::AbortIncrementalEncoding1 Unexecuted instantiation: mozjs::rust::wrappers::GetWeakMapEntry Unexecuted instantiation: mozjs::rust::wrappers::SetWeakMapEntry Unexecuted instantiation: mozjs::rust::wrappers::ProtoKeyToId Unexecuted instantiation: mozjs::rust::wrappers::ToPrimitive Unexecuted instantiation: mozjs::rust::wrappers::OrdinaryHasInstance Unexecuted instantiation: mozjs::rust::wrappers::IsMapObject Unexecuted instantiation: mozjs::rust::wrappers::IsSetObject Unexecuted instantiation: mozjs::rust::wrappers::GetSelfHostedFunction Unexecuted instantiation: mozjs::rust::wrappers::NewFunctionFromSpec Unexecuted instantiation: mozjs::rust::wrappers::PropertySpecNameEqualsId Unexecuted instantiation: mozjs::rust::wrappers::CopyArrayBuffer Unexecuted instantiation: mozjs::rust::wrappers::DetachArrayBuffer Unexecuted instantiation: mozjs::rust::wrappers::HasDefinedArrayBufferDetachKey Unexecuted instantiation: mozjs::rust::wrappers::StealArrayBufferContents Unexecuted instantiation: mozjs::rust::wrappers::ArrayBufferCopyData Unexecuted instantiation: mozjs::rust::wrappers::ArrayBufferClone Unexecuted instantiation: mozjs::rust::wrappers::ToBigInt Unexecuted instantiation: mozjs::rust::wrappers::BigIntToString Unexecuted instantiation: mozjs::rust::wrappers::Evaluate Unexecuted instantiation: mozjs::rust::wrappers::Evaluate1 Unexecuted instantiation: mozjs::rust::wrappers::Evaluate2 Unexecuted instantiation: mozjs::rust::wrappers::EvaluateUtf8Path Unexecuted instantiation: mozjs::rust::wrappers::CompileFunction Unexecuted instantiation: mozjs::rust::wrappers::CompileFunction1 Unexecuted instantiation: mozjs::rust::wrappers::CompileFunctionUtf8 Unexecuted instantiation: mozjs::rust::wrappers::ExposeScriptToDebugger Unexecuted instantiation: mozjs::rust::wrappers::UpdateDebugMetadata Unexecuted instantiation: mozjs::rust::wrappers::OrdinaryToPrimitive Unexecuted instantiation: mozjs::rust::wrappers::ObjectIsDate Unexecuted instantiation: mozjs::rust::wrappers::StrictlyEqual Unexecuted instantiation: mozjs::rust::wrappers::LooselyEqual Unexecuted instantiation: mozjs::rust::wrappers::SameValue Unexecuted instantiation: mozjs::rust::wrappers::ToJSONMaybeSafely Unexecuted instantiation: mozjs::rust::wrappers::ToJSON Unexecuted instantiation: mozjs::rust::wrappers::ParseJSONWithHandler Unexecuted instantiation: mozjs::rust::wrappers::ParseJSONWithHandler1 Unexecuted instantiation: mozjs::rust::wrappers::AddSizeOfTab Unexecuted instantiation: mozjs::rust::wrappers::FinishDynamicModuleImport Unexecuted instantiation: mozjs::rust::wrappers::ModuleLink Unexecuted instantiation: mozjs::rust::wrappers::ModuleEvaluate Unexecuted instantiation: mozjs::rust::wrappers::ThrowOnModuleEvaluationFailure Unexecuted instantiation: mozjs::rust::wrappers::GetRequestedModulesCount Unexecuted instantiation: mozjs::rust::wrappers::GetRequestedModuleSpecifier Unexecuted instantiation: mozjs::rust::wrappers::GetRequestedModuleSourcePos Unexecuted instantiation: mozjs::rust::wrappers::GetModuleScript Unexecuted instantiation: mozjs::rust::wrappers::CreateModuleRequest Unexecuted instantiation: mozjs::rust::wrappers::GetModuleRequestSpecifier Unexecuted instantiation: mozjs::rust::wrappers::GetModuleObject Unexecuted instantiation: mozjs::rust::wrappers::GetModuleNamespace Unexecuted instantiation: mozjs::rust::wrappers::GetModuleForNamespace Unexecuted instantiation: mozjs::rust::wrappers::GetModuleEnvironment Unexecuted instantiation: mozjs::rust::wrappers::GetBuiltinClass Unexecuted instantiation: mozjs::rust::wrappers::NewPromiseObject Unexecuted instantiation: mozjs::rust::wrappers::IsPromiseObject Unexecuted instantiation: mozjs::rust::wrappers::GetPromiseState Unexecuted instantiation: mozjs::rust::wrappers::GetPromiseID Unexecuted instantiation: mozjs::rust::wrappers::GetPromiseIsHandled Unexecuted instantiation: mozjs::rust::wrappers::SetSettledPromiseIsHandled Unexecuted instantiation: mozjs::rust::wrappers::SetAnyPromiseIsHandled Unexecuted instantiation: mozjs::rust::wrappers::GetPromiseAllocationSite Unexecuted instantiation: mozjs::rust::wrappers::GetPromiseResolutionSite Unexecuted instantiation: mozjs::rust::wrappers::CallOriginalPromiseResolve Unexecuted instantiation: mozjs::rust::wrappers::CallOriginalPromiseReject Unexecuted instantiation: mozjs::rust::wrappers::ResolvePromise Unexecuted instantiation: mozjs::rust::wrappers::RejectPromise Unexecuted instantiation: mozjs::rust::wrappers::CallOriginalPromiseThen Unexecuted instantiation: mozjs::rust::wrappers::AddPromiseReactions Unexecuted instantiation: mozjs::rust::wrappers::AddPromiseReactionsIgnoringUnhandledRejection Unexecuted instantiation: mozjs::rust::wrappers::GetPromiseUserInputEventHandlingState Unexecuted instantiation: mozjs::rust::wrappers::SetPromiseUserInputEventHandlingState Unexecuted instantiation: mozjs::rust::wrappers::GetWaitForAllPromise Unexecuted instantiation: mozjs::rust::wrappers::NewArrayObject Unexecuted instantiation: mozjs::rust::wrappers::IsArrayObject Unexecuted instantiation: mozjs::rust::wrappers::IsArrayObject1 Unexecuted instantiation: mozjs::rust::wrappers::GetArrayLength Unexecuted instantiation: mozjs::rust::wrappers::SetArrayLength Unexecuted instantiation: mozjs::rust::wrappers::IsArray Unexecuted instantiation: mozjs::rust::wrappers::IsArray1 Unexecuted instantiation: mozjs::rust::wrappers::SetRegExpInput Unexecuted instantiation: mozjs::rust::wrappers::ClearRegExpStatics Unexecuted instantiation: mozjs::rust::wrappers::ExecuteRegExp Unexecuted instantiation: mozjs::rust::wrappers::ExecuteRegExpNoStatics Unexecuted instantiation: mozjs::rust::wrappers::ObjectIsRegExp Unexecuted instantiation: mozjs::rust::wrappers::GetRegExpSource Unexecuted instantiation: mozjs::rust::wrappers::CheckRegExpSyntax Unexecuted instantiation: mozjs::rust::wrappers::GetSavedFrameSource Unexecuted instantiation: mozjs::rust::wrappers::GetSavedFrameSourceId Unexecuted instantiation: mozjs::rust::wrappers::GetSavedFrameLine Unexecuted instantiation: mozjs::rust::wrappers::GetSavedFrameColumn Unexecuted instantiation: mozjs::rust::wrappers::GetSavedFrameFunctionDisplayName Unexecuted instantiation: mozjs::rust::wrappers::GetSavedFrameAsyncCause Unexecuted instantiation: mozjs::rust::wrappers::GetSavedFrameAsyncParent Unexecuted instantiation: mozjs::rust::wrappers::GetSavedFrameParent Unexecuted instantiation: mozjs::rust::wrappers::ConvertSavedFrameToPlainObject Unexecuted instantiation: mozjs::rust::wrappers::NewReadableDefaultStreamObject Unexecuted instantiation: mozjs::rust::wrappers::NewReadableExternalSourceStreamObject Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamGetExternalUnderlyingSource Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamReleaseExternalUnderlyingSource Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamUpdateDataAvailableFromSource Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamGetMode Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamIsReadable Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamIsLocked Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamIsDisturbed Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamCancel Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamGetReader Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamTee Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamClose Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamReaderIsClosed Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamEnqueue Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamError Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamReaderCancel Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamReaderReleaseLock Unexecuted instantiation: mozjs::rust::wrappers::ReadableStreamDefaultReaderRead Unexecuted instantiation: mozjs::rust::wrappers::IsWasmModuleObject Unexecuted instantiation: mozjs::rust::wrappers::GetWasmModule Unexecuted instantiation: mozjs::rust::wrappers::ForceLexicalInitialization Unexecuted instantiation: mozjs::rust::wrappers::JS_CallFunctionValue Unexecuted instantiation: mozjs::rust::wrappers::JS_CallFunction Unexecuted instantiation: mozjs::rust::wrappers::JS_CallFunctionName Unexecuted instantiation: mozjs::rust::wrappers::JS_EncodeStringToUTF8 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineDebuggerObject Unexecuted instantiation: mozjs::rust::wrappers::JS_GetPendingException Unexecuted instantiation: mozjs::rust::wrappers::JS_SetPendingException Unexecuted instantiation: mozjs::rust::wrappers::JS_ErrorFromException Unexecuted instantiation: mozjs::rust::wrappers::JS_FireOnNewGlobalObject Unexecuted instantiation: mozjs::rust::wrappers::JS_DefinePropertyById Unexecuted instantiation: mozjs::rust::wrappers::JS_DefinePropertyById1 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefinePropertyById2 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefinePropertyById3 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefinePropertyById4 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefinePropertyById5 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefinePropertyById6 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefinePropertyById7 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefinePropertyById8 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefinePropertyById9 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineProperty1 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineProperty2 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineProperty3 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineProperty4 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineProperty5 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineProperty6 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineProperty7 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineUCProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineUCProperty1 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineUCProperty2 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineUCProperty3 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineUCProperty4 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineUCProperty5 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineUCProperty6 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineUCProperty7 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineUCProperty8 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineElement Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineElement1 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineElement2 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineElement3 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineElement4 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineElement5 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineElement6 Unexecuted instantiation: mozjs::rust::wrappers::JS_HasPropertyById Unexecuted instantiation: mozjs::rust::wrappers::JS_HasProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_HasUCProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_HasElement Unexecuted instantiation: mozjs::rust::wrappers::JS_HasOwnPropertyById Unexecuted instantiation: mozjs::rust::wrappers::JS_HasOwnProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_ForwardGetPropertyTo Unexecuted instantiation: mozjs::rust::wrappers::JS_ForwardGetElementTo Unexecuted instantiation: mozjs::rust::wrappers::JS_GetPropertyById Unexecuted instantiation: mozjs::rust::wrappers::JS_GetProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_GetUCProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_GetElement Unexecuted instantiation: mozjs::rust::wrappers::JS_ForwardSetPropertyTo Unexecuted instantiation: mozjs::rust::wrappers::JS_SetPropertyById Unexecuted instantiation: mozjs::rust::wrappers::JS_SetProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_SetUCProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_SetElement Unexecuted instantiation: mozjs::rust::wrappers::JS_SetElement1 Unexecuted instantiation: mozjs::rust::wrappers::JS_SetElement2 Unexecuted instantiation: mozjs::rust::wrappers::JS_SetElement3 Unexecuted instantiation: mozjs::rust::wrappers::JS_SetElement4 Unexecuted instantiation: mozjs::rust::wrappers::JS_SetElement5 Unexecuted instantiation: mozjs::rust::wrappers::JS_DeletePropertyById Unexecuted instantiation: mozjs::rust::wrappers::JS_DeleteProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_DeleteUCProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_DeleteElement Unexecuted instantiation: mozjs::rust::wrappers::JS_DeletePropertyById1 Unexecuted instantiation: mozjs::rust::wrappers::JS_DeleteProperty1 Unexecuted instantiation: mozjs::rust::wrappers::JS_DeleteElement1 Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineObject Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineProperties Unexecuted instantiation: mozjs::rust::wrappers::JS_AlreadyHasOwnPropertyById Unexecuted instantiation: mozjs::rust::wrappers::JS_AlreadyHasOwnProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_AlreadyHasOwnUCProperty Unexecuted instantiation: mozjs::rust::wrappers::JS_AlreadyHasOwnElement Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineFunctions Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineFunction Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineUCFunction Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineFunctionById Unexecuted instantiation: mozjs::rust::wrappers::JS_NewDependentString Unexecuted instantiation: mozjs::rust::wrappers::JS_ConcatStrings Unexecuted instantiation: mozjs::rust::wrappers::JS_RefreshCrossCompartmentWrappers Unexecuted instantiation: mozjs::rust::wrappers::JS_ValueToObject Unexecuted instantiation: mozjs::rust::wrappers::JS_ValueToFunction Unexecuted instantiation: mozjs::rust::wrappers::JS_ValueToConstructor Unexecuted instantiation: mozjs::rust::wrappers::JS_ValueToSource Unexecuted instantiation: mozjs::rust::wrappers::JS_TypeOfValue Unexecuted instantiation: mozjs::rust::wrappers::JS_WrapObject Unexecuted instantiation: mozjs::rust::wrappers::JS_WrapValue Unexecuted instantiation: mozjs::rust::wrappers::JS_TransplantObject Unexecuted instantiation: mozjs::rust::wrappers::JS_ResolveStandardClass Unexecuted instantiation: mozjs::rust::wrappers::JS_EnumerateStandardClasses Unexecuted instantiation: mozjs::rust::wrappers::JS_NewEnumerateStandardClasses Unexecuted instantiation: mozjs::rust::wrappers::JS_NewEnumerateStandardClassesIncludingResolved Unexecuted instantiation: mozjs::rust::wrappers::JS_GetClassObject Unexecuted instantiation: mozjs::rust::wrappers::JS_GetClassPrototype Unexecuted instantiation: mozjs::rust::wrappers::JS_IdToProtoKey Unexecuted instantiation: mozjs::rust::wrappers::JS_InitReflectParse Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineProfilingFunctions Unexecuted instantiation: mozjs::rust::wrappers::JS_ValueToId Unexecuted instantiation: mozjs::rust::wrappers::JS_StringToId Unexecuted instantiation: mozjs::rust::wrappers::JS_IdToValue Unexecuted instantiation: mozjs::rust::wrappers::JS_InitClass Unexecuted instantiation: mozjs::rust::wrappers::JS_LinkConstructorAndPrototype Unexecuted instantiation: mozjs::rust::wrappers::JS_InstanceOf Unexecuted instantiation: mozjs::rust::wrappers::JS_HasInstance Unexecuted instantiation: mozjs::rust::wrappers::JS_GetConstructor Unexecuted instantiation: mozjs::rust::wrappers::JS_NewObjectWithGivenProto Unexecuted instantiation: mozjs::rust::wrappers::JS_DeepFreezeObject Unexecuted instantiation: mozjs::rust::wrappers::JS_FreezeObject Unexecuted instantiation: mozjs::rust::wrappers::JS_GetPrototype Unexecuted instantiation: mozjs::rust::wrappers::JS_GetPrototypeIfOrdinary Unexecuted instantiation: mozjs::rust::wrappers::JS_SetPrototype Unexecuted instantiation: mozjs::rust::wrappers::JS_IsExtensible Unexecuted instantiation: mozjs::rust::wrappers::JS_PreventExtensions Unexecuted instantiation: mozjs::rust::wrappers::JS_SetImmutablePrototype Unexecuted instantiation: mozjs::rust::wrappers::JS_AssignObject Unexecuted instantiation: mozjs::rust::wrappers::JS_SetAllNonReservedSlotsToUndefined Unexecuted instantiation: mozjs::rust::wrappers::JS_GetFunctionId Unexecuted instantiation: mozjs::rust::wrappers::JS_GetFunctionDisplayId Unexecuted instantiation: mozjs::rust::wrappers::JS_GetFunctionLength Unexecuted instantiation: mozjs::rust::wrappers::JS_GetFunctionScript Unexecuted instantiation: mozjs::rust::wrappers::JS_DecompileScript Unexecuted instantiation: mozjs::rust::wrappers::JS_DecompileFunction Unexecuted instantiation: mozjs::rust::wrappers::JS_IndexToId Unexecuted instantiation: mozjs::rust::wrappers::JS_CharsToId Unexecuted instantiation: mozjs::rust::wrappers::JS_IsIdentifier Unexecuted instantiation: mozjs::rust::wrappers::JS_Utf8BufferIsCompilableUnit Unexecuted instantiation: mozjs::rust::wrappers::JS_ExecuteScript Unexecuted instantiation: mozjs::rust::wrappers::JS_ExecuteScript1 Unexecuted instantiation: mozjs::rust::wrappers::JS_ExecuteScript2 Unexecuted instantiation: mozjs::rust::wrappers::JS_ExecuteScript3 Unexecuted instantiation: mozjs::rust::wrappers::JS_Stringify Unexecuted instantiation: mozjs::rust::wrappers::JS_ParseJSON Unexecuted instantiation: mozjs::rust::wrappers::JS_ParseJSON1 Unexecuted instantiation: mozjs::rust::wrappers::JS_ParseJSON2 Unexecuted instantiation: mozjs::rust::wrappers::JS_ParseJSONWithReviver Unexecuted instantiation: mozjs::rust::wrappers::JS_ParseJSONWithReviver1 Unexecuted instantiation: mozjs::rust::wrappers::JS_ReadStructuredClone Unexecuted instantiation: mozjs::rust::wrappers::JS_WriteStructuredClone Unexecuted instantiation: mozjs::rust::wrappers::JS_StructuredClone Unexecuted instantiation: mozjs::rust::wrappers::JS_ReadString Unexecuted instantiation: mozjs::rust::wrappers::JS_ReadTypedArray Unexecuted instantiation: mozjs::rust::wrappers::JS_WriteString Unexecuted instantiation: mozjs::rust::wrappers::JS_WriteTypedArray Unexecuted instantiation: mozjs::rust::wrappers::JS_ObjectNotWritten Unexecuted instantiation: mozjs::rust::wrappers::JS_NewInt8ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewInt8ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewUint8ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewUint8ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewInt16ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewInt16ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewUint16ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewUint16ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewInt32ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewInt32ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewUint32ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewUint32ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewFloat32ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewFloat32ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewFloat64ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewFloat64ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewUint8ClampedArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewUint8ClampedArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewBigInt64ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewBigInt64ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewBigUint64ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewBigUint64ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewFloat16ArrayFromArray Unexecuted instantiation: mozjs::rust::wrappers::JS_NewFloat16ArrayWithBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_GetArrayBufferViewBuffer Unexecuted instantiation: mozjs::rust::wrappers::JS_NewDataView Unexecuted instantiation: mozjs::rust::wrappers::JS_FindCompilationScope Unexecuted instantiation: mozjs::rust::wrappers::JS_NewObjectWithoutMetadata Unexecuted instantiation: mozjs::rust::wrappers::JS_NondeterministicGetWeakMapKeys Unexecuted instantiation: mozjs::rust::wrappers::JS_NondeterministicGetWeakSetKeys Unexecuted instantiation: mozjs::rust::wrappers::JS_CloneObject Unexecuted instantiation: mozjs::rust::wrappers::JS_InitializePropertiesFromCompatibleNativeObject Unexecuted instantiation: mozjs::rust::wrappers::JS_CopyOwnPropertiesAndPrivateFields Unexecuted instantiation: mozjs::rust::wrappers::JS_WrapPropertyDescriptor Unexecuted instantiation: mozjs::rust::wrappers::JS_DefineFunctionsWithHelp Unexecuted instantiation: mozjs::rust::wrappers::JS_ForOfIteratorInit Unexecuted instantiation: mozjs::rust::wrappers::JS_ForOfIteratorNext Unexecuted instantiation: mozjs::rust::wrappers::FromPropertyDescriptor Unexecuted instantiation: mozjs::rust::wrappers::JS_GetPropertyDescriptor Unexecuted instantiation: mozjs::rust::wrappers::JS_GetOwnPropertyDescriptorById Unexecuted instantiation: mozjs::rust::wrappers::JS_GetOwnPropertyDescriptor Unexecuted instantiation: mozjs::rust::wrappers::JS_GetOwnUCPropertyDescriptor Unexecuted instantiation: mozjs::rust::wrappers::JS_GetPropertyDescriptorById Unexecuted instantiation: mozjs::rust::wrappers::JS_GetUCPropertyDescriptor Unexecuted instantiation: mozjs::rust::wrappers::SetPropertyIgnoringNamedGetter Unexecuted instantiation: mozjs::rust::wrappers::CreateError Unexecuted instantiation: mozjs::rust::wrappers::GetExceptionCause Unexecuted instantiation: mozjs::rust::wrappers::InvokeGetOwnPropertyDescriptor Unexecuted instantiation: mozjs::rust::wrappers::InvokeHasOwn Unexecuted instantiation: mozjs::rust::wrappers::CallJitGetterOp Unexecuted instantiation: mozjs::rust::wrappers::CallJitSetterOp Unexecuted instantiation: mozjs::rust::wrappers::CallJitMethodOp Unexecuted instantiation: mozjs::rust::wrappers::NewProxyObject Unexecuted instantiation: mozjs::rust::wrappers::WrapperNew Unexecuted instantiation: mozjs::rust::wrappers::NewWindowProxy Unexecuted instantiation: mozjs::rust::wrappers::RUST_JSID_IS_INT Unexecuted instantiation: mozjs::rust::wrappers::int_to_jsid Unexecuted instantiation: mozjs::rust::wrappers::RUST_JSID_TO_INT Unexecuted instantiation: mozjs::rust::wrappers::RUST_JSID_IS_STRING Unexecuted instantiation: mozjs::rust::wrappers::RUST_JSID_TO_STRING Unexecuted instantiation: mozjs::rust::wrappers::RUST_SYMBOL_TO_JSID Unexecuted instantiation: mozjs::rust::wrappers::RUST_JSID_IS_VOID Unexecuted instantiation: mozjs::rust::wrappers::RUST_INTERNED_STRING_TO_JSID Unexecuted instantiation: mozjs::rust::wrappers::AppendToIdVector Unexecuted instantiation: mozjs::rust::wrappers::JS_GetPromiseResult Unexecuted instantiation: mozjs::rust::wrappers::JS_GetScriptPrivate Unexecuted instantiation: mozjs::rust::wrappers::JS_MaybeGetScriptPrivate Unexecuted instantiation: mozjs::rust::wrappers::JS_GetModulePrivate Unexecuted instantiation: mozjs::rust::wrappers::JS_GetScriptedCallerPrivate Unexecuted instantiation: mozjs::rust::wrappers::JS_GetRegExpFlags Unexecuted instantiation: mozjs::rust::wrappers::EncodeStringToUTF8 Unexecuted instantiation: mozjs::rust::wrappers::SetDataPropertyDescriptor Unexecuted instantiation: mozjs::rust::wrappers::SetAccessorPropertyDescriptor |
1072 | | }; |
1073 | | ($module:tt: pub fn $func_name:ident($($args:tt)*) -> $outtype:ty) => { |
1074 | | wrap!(@inner ($module: $func_name ($($args)*) -> $outtype) <> () <> $($args)* ,); |
1075 | | }; |
1076 | | ($module:tt: pub fn $func_name:ident($($args:tt)*)) => { |
1077 | | wrap!($module: pub fn $func_name($($args)*) -> ()); |
1078 | | } |
1079 | | } |
1080 | | |
1081 | | use super::*; |
1082 | | use crate::glue; |
1083 | | use crate::glue::EncodedStringCallback; |
1084 | | use crate::jsapi; |
1085 | | use crate::jsapi::jsid; |
1086 | | use crate::jsapi::mozilla::Utf8Unit; |
1087 | | use crate::jsapi::BigInt; |
1088 | | use crate::jsapi::CallArgs; |
1089 | | use crate::jsapi::CloneDataPolicy; |
1090 | | use crate::jsapi::ColumnNumberOneOrigin; |
1091 | | use crate::jsapi::CompartmentTransplantCallback; |
1092 | | use crate::jsapi::JSONParseHandler; |
1093 | | use crate::jsapi::Latin1Char; |
1094 | | use crate::jsapi::PropertyKey; |
1095 | | use crate::jsapi::TaggedColumnNumberOneOrigin; |
1096 | | //use jsapi::DynamicImportStatus; |
1097 | | use crate::jsapi::ESClass; |
1098 | | use crate::jsapi::ExceptionStackBehavior; |
1099 | | use crate::jsapi::ForOfIterator; |
1100 | | use crate::jsapi::ForOfIterator_NonIterableBehavior; |
1101 | | use crate::jsapi::HandleObjectVector; |
1102 | | use crate::jsapi::InstantiateOptions; |
1103 | | use crate::jsapi::JSClass; |
1104 | | use crate::jsapi::JSErrorReport; |
1105 | | use crate::jsapi::JSExnType; |
1106 | | use crate::jsapi::JSFunctionSpecWithHelp; |
1107 | | use crate::jsapi::JSJitInfo; |
1108 | | use crate::jsapi::JSONWriteCallback; |
1109 | | use crate::jsapi::JSPrincipals; |
1110 | | use crate::jsapi::JSPropertySpec; |
1111 | | use crate::jsapi::JSPropertySpec_Name; |
1112 | | use crate::jsapi::JSProtoKey; |
1113 | | use crate::jsapi::JSScript; |
1114 | | use crate::jsapi::JSStructuredCloneData; |
1115 | | use crate::jsapi::JSType; |
1116 | | use crate::jsapi::ModuleErrorBehaviour; |
1117 | | use crate::jsapi::MutableHandleIdVector; |
1118 | | use crate::jsapi::PromiseState; |
1119 | | use crate::jsapi::PromiseUserInputEventHandlingState; |
1120 | | use crate::jsapi::ReadOnlyCompileOptions; |
1121 | | use crate::jsapi::ReadableStreamMode; |
1122 | | use crate::jsapi::ReadableStreamReaderMode; |
1123 | | use crate::jsapi::ReadableStreamUnderlyingSource; |
1124 | | use crate::jsapi::Realm; |
1125 | | use crate::jsapi::RefPtr; |
1126 | | use crate::jsapi::RegExpFlags; |
1127 | | use crate::jsapi::ScriptEnvironmentPreparer_Closure; |
1128 | | use crate::jsapi::SourceText; |
1129 | | use crate::jsapi::StackCapture; |
1130 | | use crate::jsapi::StructuredCloneScope; |
1131 | | use crate::jsapi::Symbol; |
1132 | | use crate::jsapi::SymbolCode; |
1133 | | use crate::jsapi::TwoByteChars; |
1134 | | use crate::jsapi::UniqueChars; |
1135 | | use crate::jsapi::Value; |
1136 | | use crate::jsapi::WasmModule; |
1137 | | use crate::jsapi::{ElementAdder, IsArrayAnswer, PropertyDescriptor}; |
1138 | | use crate::jsapi::{JSContext, JSFunction, JSNative, JSObject, JSString}; |
1139 | | use crate::jsapi::{ |
1140 | | JSStructuredCloneCallbacks, JSStructuredCloneReader, JSStructuredCloneWriter, |
1141 | | }; |
1142 | | use crate::jsapi::{MallocSizeOf, ObjectOpResult, ObjectPrivateVisitor, TabSizes}; |
1143 | | use crate::jsapi::{SavedFrameResult, SavedFrameSelfHosted}; |
1144 | | include!("jsapi_wrappers.in"); |
1145 | | include!("glue_wrappers.in"); |
1146 | | } |
1147 | | |
1148 | | /** Wrappers for JSAPI methods that accept lifetimed Handle and MutableHandle arguments. |
1149 | | * |
1150 | | * The wrapped methods are identical except that they accept Handle and MutableHandle arguments |
1151 | | * that include lifetimes instead. Besides, they mutably borrow the mutable handles |
1152 | | * instead of consuming/copying them. |
1153 | | * |
1154 | | * These wrappers are preferred, js::rust::wrappers should NOT be used. |
1155 | | * */ |
1156 | | pub mod jsapi_wrapped { |
1157 | | macro_rules! wrap { |
1158 | | // The invocation of @inner has the following form: |
1159 | | // @inner (input args) <> (argument accumulator) <> (invocation accumulator) <> unparsed tokens |
1160 | | // when `unparsed tokens == \eps`, accumulator contains the final result |
1161 | | |
1162 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: Handle<$gentype:ty>, $($rest:tt)*) => { |
1163 | | wrap!(@inner $saved <> ($($declargs)* $arg: Handle<$gentype> , ) <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1164 | | }; |
1165 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: MutableHandle<$gentype:ty>, $($rest:tt)*) => { |
1166 | | wrap!(@inner $saved <> ($($declargs)* $arg: &mut MutableHandle<$gentype> , ) <> ($($acc,)* (*$arg).into(),) <> $($rest)*); |
1167 | | }; |
1168 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: Handle, $($rest:tt)*) => { |
1169 | | wrap!(@inner $saved <> ($($declargs)* $arg: Handle , ) <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1170 | | }; |
1171 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: MutableHandle, $($rest:tt)*) => { |
1172 | | wrap!(@inner $saved <> ($($declargs)* $arg: &mut MutableHandle , ) <> ($($acc,)* (*$arg).into(),) <> $($rest)*); |
1173 | | }; |
1174 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: HandleFunction , $($rest:tt)*) => { |
1175 | | wrap!(@inner $saved <> ($($declargs)* $arg: HandleFunction , ) <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1176 | | }; |
1177 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: HandleId , $($rest:tt)*) => { |
1178 | | wrap!(@inner $saved <> ($($declargs)* $arg: HandleId , ) <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1179 | | }; |
1180 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: HandleObject , $($rest:tt)*) => { |
1181 | | wrap!(@inner $saved <> ($($declargs)* $arg: HandleObject , ) <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1182 | | }; |
1183 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: HandleScript , $($rest:tt)*) => { |
1184 | | wrap!(@inner $saved <> ($($declargs)* $arg: HandleScript , ) <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1185 | | }; |
1186 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: HandleString , $($rest:tt)*) => { |
1187 | | wrap!(@inner $saved <> ($($declargs)* $arg: HandleString , ) <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1188 | | }; |
1189 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: HandleSymbol , $($rest:tt)*) => { |
1190 | | wrap!(@inner $saved <> ($($declargs)* $arg: HandleSymbol , ) <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1191 | | }; |
1192 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: HandleValue , $($rest:tt)*) => { |
1193 | | wrap!(@inner $saved <> ($($declargs)* $arg: HandleValue , ) <> ($($acc,)* $arg.into(),) <> $($rest)*); |
1194 | | }; |
1195 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: MutableHandleFunction , $($rest:tt)*) => { |
1196 | | wrap!(@inner $saved <> ($($declargs)* $arg: &mut MutableHandleFunction , ) <> ($($acc,)* (*$arg).into(),) <> $($rest)*); |
1197 | | }; |
1198 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: MutableHandleId , $($rest:tt)*) => { |
1199 | | wrap!(@inner $saved <> ($($declargs)* $arg: &mut MutableHandleId , ) <> ($($acc,)* (*$arg).into(),) <> $($rest)*); |
1200 | | }; |
1201 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: MutableHandleObject , $($rest:tt)*) => { |
1202 | | wrap!(@inner $saved <> ($($declargs)* $arg: &mut MutableHandleObject , ) <> ($($acc,)* (*$arg).into(),) <> $($rest)*); |
1203 | | }; |
1204 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: MutableHandleScript , $($rest:tt)*) => { |
1205 | | wrap!(@inner $saved <> ($($declargs)* $arg: &mut MutableHandleScript , ) <> ($($acc,)* (*$arg).into(),) <> $($rest)*); |
1206 | | }; |
1207 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: MutableHandleString , $($rest:tt)*) => { |
1208 | | wrap!(@inner $saved <> ($($declargs)* $arg: &mut MutableHandleString , ) <> ($($acc,)* (*$arg).into(),) <> $($rest)*); |
1209 | | }; |
1210 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: MutableHandleSymbol , $($rest:tt)*) => { |
1211 | | wrap!(@inner $saved <> ($($declargs)* $arg: &mut MutableHandleSymbol , ) <> ($($acc,)* (*$arg).into(),) <> $($rest)*); |
1212 | | }; |
1213 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: MutableHandleValue , $($rest:tt)*) => { |
1214 | | wrap!(@inner $saved <> ($($declargs)* $arg: &mut MutableHandleValue , ) <> ($($acc,)* (*$arg).into(),) <> $($rest)*); |
1215 | | }; |
1216 | | (@inner $saved:tt <> ($($declargs:tt)*) <> ($($acc:expr,)*) <> $arg:ident: $type:ty, $($rest:tt)*) => { |
1217 | | wrap!(@inner $saved <> ($($declargs)* $arg: $type,) <> ($($acc,)* $arg,) <> $($rest)*); |
1218 | | }; |
1219 | | (@inner ($module:tt: $func_name:ident ($($args:tt)*) -> $outtype:ty) <> ($($declargs:tt)*) <> ($($argexprs:expr,)*) <> ) => { |
1220 | | #[inline] |
1221 | 0 | pub unsafe fn $func_name($($declargs)*) -> $outtype { |
1222 | 0 | $module::$func_name($($argexprs),*) |
1223 | 0 | } Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToBooleanSlow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToNumberSlow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToInt8Slow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToUint8Slow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToInt16Slow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToInt32Slow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToUint32Slow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToUint16Slow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToInt64Slow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToUint64Slow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToStringSlow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToObjectSlow Unexecuted instantiation: mozjs::rust::jsapi_wrapped::NukeNonCCWProxy Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetFirstSubsumedSavedFrame Unexecuted instantiation: mozjs::rust::jsapi_wrapped::TransparentObjectWrapper Unexecuted instantiation: mozjs::rust::jsapi_wrapped::UnwrapOneCheckedDynamic Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RemapDeadWrapper Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RemapAllWrappersForObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetWindowProxy Unexecuted instantiation: mozjs::rust::jsapi_wrapped::IsArgumentsObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::EnqueueJob Unexecuted instantiation: mozjs::rust::jsapi_wrapped::AssertSameCompartment1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::NewFunctionByIdWithReservedAndProto Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetObjectProto Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetRealmOriginalEval Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetPropertyKeys Unexecuted instantiation: mozjs::rust::jsapi_wrapped::DateIsValid Unexecuted instantiation: mozjs::rust::jsapi_wrapped::DateGetMsecSinceEpoch Unexecuted instantiation: mozjs::rust::jsapi_wrapped::PrepareScriptEnvironmentAndInvoke Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetElementsWithAdder Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ExecuteInFrameScriptEnvironment Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReportIsNotFunction Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RemapRemoteWindowProxies Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ComputeThis Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MaybeFreezeCtorAndPrototype Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetFunctionRealm Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CaptureCurrentStack Unexecuted instantiation: mozjs::rust::jsapi_wrapped::BuildStackString Unexecuted instantiation: mozjs::rust::jsapi_wrapped::Call Unexecuted instantiation: mozjs::rust::jsapi_wrapped::Construct Unexecuted instantiation: mozjs::rust::jsapi_wrapped::Construct1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToGetterId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToSetterId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ExceptionStackOrNull Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MapSize Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MapGet Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MapHas Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MapSet Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MapDelete Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MapClear Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MapKeys Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MapValues Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MapEntries Unexecuted instantiation: mozjs::rust::jsapi_wrapped::MapForEach Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetSize Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetHas Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetDelete Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetAdd Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetClear Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetKeys Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetValues Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetEntries Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetForEach Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToCompletePropertyDescriptor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::NewSymbol Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSymbolFor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSymbolDescription Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSymbolCode Unexecuted instantiation: mozjs::rust::jsapi_wrapped::AbortIncrementalEncoding Unexecuted instantiation: mozjs::rust::jsapi_wrapped::AbortIncrementalEncoding1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetWeakMapEntry Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetWeakMapEntry Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ProtoKeyToId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToPrimitive Unexecuted instantiation: mozjs::rust::jsapi_wrapped::OrdinaryHasInstance Unexecuted instantiation: mozjs::rust::jsapi_wrapped::IsMapObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::IsSetObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSelfHostedFunction Unexecuted instantiation: mozjs::rust::jsapi_wrapped::NewFunctionFromSpec Unexecuted instantiation: mozjs::rust::jsapi_wrapped::PropertySpecNameEqualsId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CopyArrayBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::DetachArrayBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::HasDefinedArrayBufferDetachKey Unexecuted instantiation: mozjs::rust::jsapi_wrapped::StealArrayBufferContents Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ArrayBufferCopyData Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ArrayBufferClone Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToBigInt Unexecuted instantiation: mozjs::rust::jsapi_wrapped::BigIntToString Unexecuted instantiation: mozjs::rust::jsapi_wrapped::Evaluate Unexecuted instantiation: mozjs::rust::jsapi_wrapped::Evaluate1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::Evaluate2 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::EvaluateUtf8Path Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CompileFunction Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CompileFunction1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CompileFunctionUtf8 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ExposeScriptToDebugger Unexecuted instantiation: mozjs::rust::jsapi_wrapped::UpdateDebugMetadata Unexecuted instantiation: mozjs::rust::jsapi_wrapped::OrdinaryToPrimitive Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ObjectIsDate Unexecuted instantiation: mozjs::rust::jsapi_wrapped::StrictlyEqual Unexecuted instantiation: mozjs::rust::jsapi_wrapped::LooselyEqual Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SameValue Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToJSONMaybeSafely Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ToJSON Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ParseJSONWithHandler Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ParseJSONWithHandler1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::AddSizeOfTab Unexecuted instantiation: mozjs::rust::jsapi_wrapped::FinishDynamicModuleImport Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ModuleLink Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ModuleEvaluate Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ThrowOnModuleEvaluationFailure Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetRequestedModulesCount Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetRequestedModuleSpecifier Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetRequestedModuleSourcePos Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetModuleScript Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CreateModuleRequest Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetModuleRequestSpecifier Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetModuleObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetModuleNamespace Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetModuleForNamespace Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetModuleEnvironment Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetBuiltinClass Unexecuted instantiation: mozjs::rust::jsapi_wrapped::NewPromiseObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::IsPromiseObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetPromiseState Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetPromiseID Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetPromiseIsHandled Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetSettledPromiseIsHandled Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetAnyPromiseIsHandled Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetPromiseAllocationSite Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetPromiseResolutionSite Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CallOriginalPromiseResolve Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CallOriginalPromiseReject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ResolvePromise Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RejectPromise Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CallOriginalPromiseThen Unexecuted instantiation: mozjs::rust::jsapi_wrapped::AddPromiseReactions Unexecuted instantiation: mozjs::rust::jsapi_wrapped::AddPromiseReactionsIgnoringUnhandledRejection Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetPromiseUserInputEventHandlingState Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetPromiseUserInputEventHandlingState Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetWaitForAllPromise Unexecuted instantiation: mozjs::rust::jsapi_wrapped::NewArrayObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::IsArrayObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::IsArrayObject1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetArrayLength Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetArrayLength Unexecuted instantiation: mozjs::rust::jsapi_wrapped::IsArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::IsArray1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetRegExpInput Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ClearRegExpStatics Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ExecuteRegExp Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ExecuteRegExpNoStatics Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ObjectIsRegExp Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetRegExpSource Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CheckRegExpSyntax Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSavedFrameSource Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSavedFrameSourceId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSavedFrameLine Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSavedFrameColumn Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSavedFrameFunctionDisplayName Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSavedFrameAsyncCause Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSavedFrameAsyncParent Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetSavedFrameParent Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ConvertSavedFrameToPlainObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::NewReadableDefaultStreamObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::NewReadableExternalSourceStreamObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamGetExternalUnderlyingSource Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamReleaseExternalUnderlyingSource Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamUpdateDataAvailableFromSource Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamGetMode Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamIsReadable Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamIsLocked Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamIsDisturbed Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamCancel Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamGetReader Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamTee Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamClose Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamReaderIsClosed Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamEnqueue Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamError Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamReaderCancel Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamReaderReleaseLock Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ReadableStreamDefaultReaderRead Unexecuted instantiation: mozjs::rust::jsapi_wrapped::IsWasmModuleObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetWasmModule Unexecuted instantiation: mozjs::rust::jsapi_wrapped::ForceLexicalInitialization Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_CallFunctionValue Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_CallFunction Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_CallFunctionName Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_EncodeStringToUTF8 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineDebuggerObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetPendingException Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetPendingException Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ErrorFromException Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_FireOnNewGlobalObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefinePropertyById Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefinePropertyById1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefinePropertyById2 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefinePropertyById3 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefinePropertyById4 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefinePropertyById5 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefinePropertyById6 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefinePropertyById7 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefinePropertyById8 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefinePropertyById9 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineProperty1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineProperty2 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineProperty3 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineProperty4 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineProperty5 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineProperty6 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineProperty7 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineUCProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineUCProperty1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineUCProperty2 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineUCProperty3 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineUCProperty4 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineUCProperty5 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineUCProperty6 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineUCProperty7 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineUCProperty8 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineElement Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineElement1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineElement2 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineElement3 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineElement4 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineElement5 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineElement6 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_HasPropertyById Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_HasProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_HasUCProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_HasElement Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_HasOwnPropertyById Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_HasOwnProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ForwardGetPropertyTo Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ForwardGetElementTo Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetPropertyById Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetUCProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetElement Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ForwardSetPropertyTo Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetPropertyById Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetUCProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetElement Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetElement1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetElement2 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetElement3 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetElement4 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetElement5 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DeletePropertyById Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DeleteProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DeleteUCProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DeleteElement Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DeletePropertyById1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DeleteProperty1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DeleteElement1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineProperties Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_AlreadyHasOwnPropertyById Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_AlreadyHasOwnProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_AlreadyHasOwnUCProperty Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_AlreadyHasOwnElement Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineFunctions Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineFunction Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineUCFunction Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineFunctionById Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewDependentString Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ConcatStrings Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_RefreshCrossCompartmentWrappers Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ValueToObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ValueToFunction Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ValueToConstructor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ValueToSource Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_TypeOfValue Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_WrapObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_WrapValue Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_TransplantObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ResolveStandardClass Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_EnumerateStandardClasses Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewEnumerateStandardClasses Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewEnumerateStandardClassesIncludingResolved Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetClassObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetClassPrototype Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_IdToProtoKey Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_InitReflectParse Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineProfilingFunctions Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ValueToId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_StringToId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_IdToValue Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_InitClass Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_LinkConstructorAndPrototype Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_InstanceOf Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_HasInstance Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetConstructor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewObjectWithGivenProto Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DeepFreezeObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_FreezeObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetPrototype Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetPrototypeIfOrdinary Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetPrototype Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_IsExtensible Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_PreventExtensions Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetImmutablePrototype Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_AssignObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_SetAllNonReservedSlotsToUndefined Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetFunctionId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetFunctionDisplayId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetFunctionLength Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetFunctionScript Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DecompileScript Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DecompileFunction Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_IndexToId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_CharsToId Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_IsIdentifier Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_Utf8BufferIsCompilableUnit Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ExecuteScript Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ExecuteScript1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ExecuteScript2 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ExecuteScript3 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_Stringify Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ParseJSON Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ParseJSON1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ParseJSON2 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ParseJSONWithReviver Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ParseJSONWithReviver1 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ReadStructuredClone Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_WriteStructuredClone Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_StructuredClone Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ReadString Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ReadTypedArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_WriteString Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_WriteTypedArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ObjectNotWritten Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewInt8ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewInt8ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewUint8ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewUint8ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewInt16ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewInt16ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewUint16ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewUint16ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewInt32ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewInt32ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewUint32ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewUint32ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewFloat32ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewFloat32ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewFloat64ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewFloat64ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewUint8ClampedArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewUint8ClampedArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewBigInt64ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewBigInt64ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewBigUint64ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewBigUint64ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewFloat16ArrayFromArray Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewFloat16ArrayWithBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetArrayBufferViewBuffer Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewDataView Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_FindCompilationScope Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NewObjectWithoutMetadata Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NondeterministicGetWeakMapKeys Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_NondeterministicGetWeakSetKeys Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_CloneObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_InitializePropertiesFromCompatibleNativeObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_CopyOwnPropertiesAndPrivateFields Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_WrapPropertyDescriptor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_DefineFunctionsWithHelp Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ForOfIteratorInit Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_ForOfIteratorNext Unexecuted instantiation: mozjs::rust::jsapi_wrapped::FromPropertyDescriptor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetPropertyDescriptor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetOwnPropertyDescriptorById Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetOwnPropertyDescriptor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetOwnUCPropertyDescriptor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetPropertyDescriptorById Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetUCPropertyDescriptor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetPropertyIgnoringNamedGetter Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CreateError Unexecuted instantiation: mozjs::rust::jsapi_wrapped::GetExceptionCause Unexecuted instantiation: mozjs::rust::jsapi_wrapped::InvokeGetOwnPropertyDescriptor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::InvokeHasOwn Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CallJitGetterOp Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CallJitSetterOp Unexecuted instantiation: mozjs::rust::jsapi_wrapped::CallJitMethodOp Unexecuted instantiation: mozjs::rust::jsapi_wrapped::NewProxyObject Unexecuted instantiation: mozjs::rust::jsapi_wrapped::WrapperNew Unexecuted instantiation: mozjs::rust::jsapi_wrapped::NewWindowProxy Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RUST_JSID_IS_INT Unexecuted instantiation: mozjs::rust::jsapi_wrapped::int_to_jsid Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RUST_JSID_TO_INT Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RUST_JSID_IS_STRING Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RUST_JSID_TO_STRING Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RUST_SYMBOL_TO_JSID Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RUST_JSID_IS_VOID Unexecuted instantiation: mozjs::rust::jsapi_wrapped::RUST_INTERNED_STRING_TO_JSID Unexecuted instantiation: mozjs::rust::jsapi_wrapped::AppendToIdVector Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetPromiseResult Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetScriptPrivate Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_MaybeGetScriptPrivate Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetModulePrivate Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetScriptedCallerPrivate Unexecuted instantiation: mozjs::rust::jsapi_wrapped::JS_GetRegExpFlags Unexecuted instantiation: mozjs::rust::jsapi_wrapped::EncodeStringToUTF8 Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetDataPropertyDescriptor Unexecuted instantiation: mozjs::rust::jsapi_wrapped::SetAccessorPropertyDescriptor |
1224 | | }; |
1225 | | ($module:tt: pub fn $func_name:ident($($args:tt)*) -> $outtype:ty) => { |
1226 | | wrap!(@inner ($module: $func_name ($($args)*) -> $outtype) <> () <> () <> $($args)* ,); |
1227 | | }; |
1228 | | ($module:tt: pub fn $func_name:ident($($args:tt)*)) => { |
1229 | | wrap!($module: pub fn $func_name($($args)*) -> ()); |
1230 | | } |
1231 | | } |
1232 | | |
1233 | | use super::*; |
1234 | | use crate::glue; |
1235 | | use crate::glue::EncodedStringCallback; |
1236 | | use crate::jsapi; |
1237 | | use crate::jsapi::mozilla::Utf8Unit; |
1238 | | use crate::jsapi::BigInt; |
1239 | | use crate::jsapi::CallArgs; |
1240 | | use crate::jsapi::CloneDataPolicy; |
1241 | | use crate::jsapi::ColumnNumberOneOrigin; |
1242 | | use crate::jsapi::CompartmentTransplantCallback; |
1243 | | use crate::jsapi::ESClass; |
1244 | | use crate::jsapi::ExceptionStackBehavior; |
1245 | | use crate::jsapi::ForOfIterator; |
1246 | | use crate::jsapi::ForOfIterator_NonIterableBehavior; |
1247 | | use crate::jsapi::HandleObjectVector; |
1248 | | use crate::jsapi::InstantiateOptions; |
1249 | | use crate::jsapi::JSClass; |
1250 | | use crate::jsapi::JSErrorReport; |
1251 | | use crate::jsapi::JSExnType; |
1252 | | use crate::jsapi::JSFunctionSpec; |
1253 | | use crate::jsapi::JSFunctionSpecWithHelp; |
1254 | | use crate::jsapi::JSJitInfo; |
1255 | | use crate::jsapi::JSONParseHandler; |
1256 | | use crate::jsapi::JSONWriteCallback; |
1257 | | use crate::jsapi::JSPrincipals; |
1258 | | use crate::jsapi::JSPropertySpec; |
1259 | | use crate::jsapi::JSPropertySpec_Name; |
1260 | | use crate::jsapi::JSProtoKey; |
1261 | | use crate::jsapi::JSScript; |
1262 | | use crate::jsapi::JSStructuredCloneData; |
1263 | | use crate::jsapi::JSType; |
1264 | | use crate::jsapi::Latin1Char; |
1265 | | use crate::jsapi::ModuleErrorBehaviour; |
1266 | | use crate::jsapi::MutableHandleIdVector; |
1267 | | use crate::jsapi::PromiseState; |
1268 | | use crate::jsapi::PromiseUserInputEventHandlingState; |
1269 | | use crate::jsapi::PropertyKey; |
1270 | | use crate::jsapi::ReadOnlyCompileOptions; |
1271 | | use crate::jsapi::ReadableStreamMode; |
1272 | | use crate::jsapi::ReadableStreamReaderMode; |
1273 | | use crate::jsapi::ReadableStreamUnderlyingSource; |
1274 | | use crate::jsapi::Realm; |
1275 | | use crate::jsapi::RefPtr; |
1276 | | use crate::jsapi::RegExpFlags; |
1277 | | use crate::jsapi::ScriptEnvironmentPreparer_Closure; |
1278 | | use crate::jsapi::SourceText; |
1279 | | use crate::jsapi::StackCapture; |
1280 | | use crate::jsapi::StructuredCloneScope; |
1281 | | use crate::jsapi::Symbol; |
1282 | | use crate::jsapi::SymbolCode; |
1283 | | use crate::jsapi::TaggedColumnNumberOneOrigin; |
1284 | | use crate::jsapi::TwoByteChars; |
1285 | | use crate::jsapi::UniqueChars; |
1286 | | use crate::jsapi::Value; |
1287 | | use crate::jsapi::WasmModule; |
1288 | | use crate::jsapi::{ElementAdder, IsArrayAnswer, PropertyDescriptor}; |
1289 | | use crate::jsapi::{JSContext, JSFunction, JSNative, JSObject, JSString}; |
1290 | | use crate::jsapi::{ |
1291 | | JSStructuredCloneCallbacks, JSStructuredCloneReader, JSStructuredCloneWriter, |
1292 | | }; |
1293 | | use crate::jsapi::{MallocSizeOf, ObjectOpResult, ObjectPrivateVisitor, TabSizes}; |
1294 | | use crate::jsapi::{SavedFrameResult, SavedFrameSelfHosted}; |
1295 | | include!("jsapi_wrappers.in"); |
1296 | | include!("glue_wrappers.in"); |
1297 | | } |