boa/builtins/undefined/
mod.rs1use crate::{builtins::BuiltIn, property::Attribute, BoaProfiler, Context, JsValue};
13
14#[cfg(test)]
15mod tests;
16
17#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
19pub(crate) struct Undefined;
20
21impl BuiltIn for Undefined {
22 const NAME: &'static str = "undefined";
23
24 fn attribute() -> Attribute {
25 Attribute::READONLY | Attribute::NON_ENUMERABLE | Attribute::PERMANENT
26 }
27
28 fn init(_: &mut Context) -> (&'static str, JsValue, Attribute) {
29 let _timer = BoaProfiler::global().start_event(Self::NAME, "init");
30
31 (Self::NAME, JsValue::undefined(), Self::attribute())
32 }
33}