Example #1
0
JSBool JavaObject::getPropertyWrapper(JSContext* ctx, JS::Handle<JSObject*> obj,
    JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) {
  jsval rval;
  JSBool result = JavaObject::getProperty(ctx, obj.get(), id.get(), &rval);
  vp.set(rval);
  return result;
}
Example #2
0
js::GetObjectProto(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> proto)
{
    if (IsProxy(obj))
        return JS_GetPrototype(cx, obj, proto);

    proto.set(reinterpret_cast<const shadow::Object*>(obj.get())->type->proto);
    return true;
}
Example #3
0
bool
JSCompartment::addToVarNames(JSContext* cx, JS::Handle<JSAtom*> name)
{
    if (varNames_.put(name.get()))
        return true;

    ReportOutOfMemory(cx);
    return false;
}
Example #4
0
js::GetObjectProto(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> proto)
{
    js::Class *clasp = GetObjectClass(obj);
    if (clasp == js::ObjectProxyClassPtr ||
        clasp == js::OuterWindowProxyClassPtr ||
        clasp == js::FunctionProxyClassPtr)
    {
        return JS_GetPrototype(cx, obj, proto);
    }

    proto.set(reinterpret_cast<const shadow::Object*>(obj.get())->type->proto);
    return true;
}