bun_sm 0.1.0

SpiderMonkey-backed API compatibility layer replacing bun_jsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Unprotect — removes GC protection from a JSObject.

use mozjs::jsapi::{JSContext, JSObject};

pub struct Unprotect {
    obj: *mut JSObject,
}

impl Unprotect {
    pub unsafe fn new(_cx: *mut JSContext, obj: *mut JSObject) -> Self {
        Unprotect { obj }
    }

    pub fn get(&self) -> *mut JSObject {
        self.obj
    }
}