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