use crate::{builtins::BuiltIn, property::Attribute, BoaProfiler, Context, JsValue};
#[cfg(test)]
mod tests;
pub(crate) struct GlobalThis;
impl BuiltIn for GlobalThis {
const NAME: &'static str = "globalThis";
fn attribute() -> Attribute {
Attribute::WRITABLE | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE
}
fn init(context: &mut Context) -> (&'static str, JsValue, Attribute) {
let _timer = BoaProfiler::global().start_event(Self::NAME, "init");
(
Self::NAME,
context.global_object().into(),
Self::attribute(),
)
}
}