1use crate::utils::*;
2
3#[derive(Clone, Debug)]
7#[repr(transparent)]
8pub struct Undefined {
9 inner: emlite::Val,
10}
11
12impl Undefined {
13 pub const VALUE: Undefined = Undefined {
19 inner: emlite::Val::undefined(),
20 };
21
22 #[inline]
24 pub fn is_null(&self) -> bool {
25 false
26 }
27
28 #[inline]
30 pub fn is_undefined(&self) -> bool {
31 true
32 }
33}
34
35bind!(Undefined);
36
37impl crate::prelude::DynCast for Undefined {
38 #[inline]
39 fn instanceof(_val: &emlite::Val) -> bool {
40 false
41 }
42 #[inline]
43 fn unchecked_from_val(v: emlite::Val) -> Self {
44 v.as_::<Self>() }
46 #[inline]
47 fn unchecked_from_val_ref(v: &emlite::Val) -> &Self {
48 unsafe { &*(v as *const emlite::Val as *const Self) }
49 }
50 #[inline]
51 fn unchecked_from_val_mut(v: &mut emlite::Val) -> &mut Self {
52 unsafe { &mut *(v as *mut emlite::Val as *mut Self) }
53 }
54}