Bug 770999 - Add get() method to Handle<T> and Rooted<T> (r=bhackett)

This commit is contained in:
Bill McCloskey 2012-07-04 13:34:42 -07:00
parent 2100b10524
commit 1775e92469
23 changed files with 79 additions and 82 deletions

View File

@ -379,10 +379,8 @@ XBLResolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags,
JS::StringValue(JSID_TO_STRING(id)));
if (!::JS_DefinePropertyById(cx, obj, id, JS::UndefinedValue(),
JS_DATA_TO_FUNC_PTR(JSPropertyOp,
get.reference()),
JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp,
set.reference()),
JS_DATA_TO_FUNC_PTR(JSPropertyOp, get.get()),
JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, set.get()),
field->AccessorAttributes())) {
return false;
}

View File

@ -794,7 +794,7 @@ private:
return false;
}
aObjp.set(resolved ? aObj.value() : NULL);
aObjp.set(resolved ? aObj.get() : NULL);
return true;
}

View File

@ -2473,7 +2473,7 @@ CheckDestructuring(JSContext *cx, BindData *data, ParseNode *left, Parser *parse
}
Rooted<StaticBlockObject *> blockObj(cx);
blockObj = data && data->binder == BindLet ? data->let.blockObj.reference() : NULL;
blockObj = data && data->binder == BindLet ? data->let.blockObj.get() : NULL;
uint32_t blockCountBefore = blockObj ? blockObj->slotCount() : 0;
if (left->isKind(PNK_RB)) {

View File

@ -106,10 +106,10 @@ class Handle
typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);
const T *address() const { return ptr; }
T value() const { return *ptr; }
T get() const { return *ptr; }
operator T () const { return value(); }
T operator ->() const { return value(); }
operator T () const { return get(); }
T operator ->() const { return get(); }
private:
Handle() {}
@ -146,12 +146,11 @@ class MutableHandle
void set(T v) { *ptr = v; }
const T *address() const { return ptr; }
T *address() { return ptr; }
T value() const { return *ptr; }
T *address() const { return ptr; }
T get() const { return *ptr; }
operator T () const { return value(); }
T operator ->() const { return value(); }
operator T () const { return get(); }
T operator ->() const { return get(); }
private:
MutableHandle() {}
@ -212,8 +211,8 @@ class Rooted
T operator ->() const { return ptr; }
T * address() { return &ptr; }
const T * address() const { return &ptr; }
T & reference() { return ptr; }
T raw() const { return ptr; }
T & get() { return ptr; }
const T & get() const { return ptr; }
T & operator =(T value)
{

View File

@ -52,7 +52,7 @@ document_resolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flag
return false;
if (JS_FlatStringEqualsAscii(flatStr, "all") && !(flags & JSRESOLVE_DETECTING)) {
JSBool ok = JS_DefinePropertyById(cx, obj, id, JSVAL_TRUE, NULL, NULL, 0);
objp.set(ok ? obj.value() : NULL);
objp.set(ok ? obj.get() : NULL);
return ok;
}
}

View File

@ -137,8 +137,8 @@ js_GetLengthProperty(JSContext *cx, JSObject *obj, uint32_t *lengthp)
if (!obj->getProperty(cx, cx->runtime->atomState.lengthAtom, value.address()))
return false;
if (value.reference().isInt32()) {
*lengthp = uint32_t(value.reference().toInt32()); /* uint32_t cast does ToUint32_t */
if (value.get().isInt32()) {
*lengthp = uint32_t(value.get().toInt32()); /* uint32_t cast does ToUint32_t */
return true;
}
@ -2175,7 +2175,7 @@ js::array_sort(JSContext *cx, unsigned argc, Value *vp)
CallArgs args = CallArgsFromVp(argc, vp);
RootedValue fvalRoot(cx);
Value &fval = fvalRoot.reference();
Value &fval = fvalRoot.get();
if (args.hasDefined(0)) {
if (args[0].isPrimitive()) {

View File

@ -266,7 +266,7 @@ JSCompartment::wrap(JSContext *cx, Value *vp)
// We maintain the invariant that the key in the cross-compartment wrapper
// map is always directly wrapped by the value.
JS_ASSERT(Wrapper::wrappedObject(wrapper) == &key.reference().toObject());
JS_ASSERT(Wrapper::wrappedObject(wrapper) == &key.get().toObject());
vp->setObject(*wrapper);
@ -287,7 +287,7 @@ JSCompartment::wrap(JSContext *cx, JSString **strp)
RootedValue value(cx, StringValue(*strp));
if (!wrap(cx, value.address()))
return false;
*strp = value.reference().toString();
*strp = value.get().toString();
return true;
}
@ -297,7 +297,7 @@ JSCompartment::wrap(JSContext *cx, HeapPtrString *strp)
RootedValue value(cx, StringValue(*strp));
if (!wrap(cx, value.address()))
return false;
*strp = value.reference().toString();
*strp = value.get().toString();
return true;
}
@ -309,7 +309,7 @@ JSCompartment::wrap(JSContext *cx, JSObject **objp)
RootedValue value(cx, ObjectValue(**objp));
if (!wrap(cx, value.address()))
return false;
*objp = &value.reference().toObject();
*objp = &value.get().toObject();
return true;
}
@ -321,7 +321,7 @@ JSCompartment::wrapId(JSContext *cx, jsid *idp)
RootedValue value(cx, IdToValue(*idp));
if (!wrap(cx, value.address()))
return false;
return ValueToId(cx, value.reference(), idp);
return ValueToId(cx, value.get(), idp);
}
bool

View File

@ -77,9 +77,9 @@ struct CrossCompartmentKey
debugger(NULL),
wrapped((js::gc::Cell *)wrapped.toGCThing()) {}
CrossCompartmentKey(const RootedValue &wrapped)
: kind(wrapped.raw().isString() ? StringWrapper : ObjectWrapper),
: kind(wrapped.get().isString() ? StringWrapper : ObjectWrapper),
debugger(NULL),
wrapped((js::gc::Cell *)wrapped.raw().toGCThing()) {}
wrapped((js::gc::Cell *)wrapped.get().toGCThing()) {}
CrossCompartmentKey(Kind kind, JSObject *dbg, js::gc::Cell *wrapped)
: kind(kind), debugger(dbg), wrapped(wrapped) {}
};

View File

@ -2556,7 +2556,7 @@ TypeCompartment::fixObjectType(JSContext *cx, JSObject *obj_)
if (obj->slotSpan() == 0 || obj->inDictionaryMode())
return;
ObjectTypeTable::AddPtr p = objectTypeTable->lookupForAdd(obj.raw());
ObjectTypeTable::AddPtr p = objectTypeTable->lookupForAdd(obj.get());
const Shape *baseShape = obj->lastProperty();
if (p) {
@ -2624,13 +2624,13 @@ TypeCompartment::fixObjectType(JSContext *cx, JSObject *obj_)
key.nslots = obj->slotSpan();
key.nfixed = obj->numFixedSlots();
key.proto = obj->getProto();
JS_ASSERT(ObjectTableKey::match(key, obj.raw()));
JS_ASSERT(ObjectTableKey::match(key, obj.get()));
ObjectTableEntry entry;
entry.object = objType;
entry.types = types;
p = objectTypeTable->lookupForAdd(obj.raw());
p = objectTypeTable->lookupForAdd(obj.get());
if (!objectTypeTable->add(p, key, entry)) {
cx->compartment->types.setPendingNukeTypes(cx);
return;
@ -5706,7 +5706,7 @@ JSObject::getNewType(JSContext *cx, JSFunction *fun)
if (!type)
return NULL;
if (!table.relookupOrAdd(p, self, type.raw()))
if (!table.relookupOrAdd(p, self, type.get()))
return NULL;
if (!cx->typeInferenceEnabled())

View File

@ -167,13 +167,13 @@ js::OnUnknownMethod(JSContext *cx, HandleObject obj, Value idval_, Value *vp)
return false;
TypeScript::MonitorUnknown(cx, cx->fp()->script(), cx->regs().pc);
if (value.reference().isPrimitive()) {
if (value.get().isPrimitive()) {
*vp = value;
} else {
#if JS_HAS_XML_SUPPORT
/* Extract the function name from function::name qname. */
if (idval.reference().isObject()) {
JSObject *obj = &idval.reference().toObject();
if (idval.get().isObject()) {
JSObject *obj = &idval.get().toObject();
if (js_GetLocalNameFromFunctionQName(obj, id.address(), cx))
idval = IdToValue(id);
}
@ -595,9 +595,9 @@ js::LooselyEqual(JSContext *cx, const Value &lval, const Value &rval, bool *resu
if (!ToPrimitive(cx, rvalue.address()))
return false;
if (lvalue.reference().isString() && rvalue.reference().isString()) {
JSString *l = lvalue.reference().toString();
JSString *r = rvalue.reference().toString();
if (lvalue.get().isString() && rvalue.get().isString()) {
JSString *l = lvalue.get().toString();
JSString *r = rvalue.get().toString();
return EqualStrings(cx, l, r, result);
}
@ -958,7 +958,7 @@ js::AssertValidPropertyCacheHit(JSContext *cx, JSObject *start_,
if (JOF_OPMODE(*pc) == JOF_NAME)
ok = FindProperty(cx, name, start, &obj, &pobj, &prop);
else
ok = baseops::LookupProperty(cx, start, name.reference(), &pobj, &prop);
ok = baseops::LookupProperty(cx, start, name, &pobj, &prop);
JS_ASSERT(ok);
if (cx->runtime->gcNumber != sample)
@ -2359,7 +2359,7 @@ BEGIN_CASE(JSOP_CALLPROP)
if (!GetPropertyOperation(cx, script, regs.pc, regs.sp[-1], rval.address()))
goto error;
TypeScript::Monitor(cx, script, regs.pc, rval.reference());
TypeScript::Monitor(cx, script, regs.pc, rval);
regs.sp[-1] = rval;
assertSameCompartment(cx, regs.sp[-1]);

View File

@ -252,7 +252,7 @@ GetPropertyOperation(JSContext *cx, JSScript *script, jsbytecode *pc, Value &lva
PropertyCacheEntry *entry;
Rooted<JSObject*> obj2(cx);
PropertyName *name;
JS_PROPERTY_CACHE(cx).test(cx, pc, obj.reference(), obj2.reference(), entry, name);
JS_PROPERTY_CACHE(cx).test(cx, pc, obj.get(), obj2.get(), entry, name);
if (!name) {
AssertValidPropertyCacheHit(cx, obj, obj2, entry);
if (!NativeGet(cx, obj, obj2, entry->prop, JSGET_CACHE_RESULT, vp))
@ -377,7 +377,7 @@ NameOperation(JSContext *cx, JSScript *script, jsbytecode *pc, Value *vp)
PropertyCacheEntry *entry;
Rooted<JSObject*> obj2(cx);
RootedPropertyName name(cx);
JS_PROPERTY_CACHE(cx).test(cx, pc, obj.reference(), obj2.reference(), entry, name.reference());
JS_PROPERTY_CACHE(cx).test(cx, pc, obj.get(), obj2.get(), entry, name.get());
if (!name) {
AssertValidPropertyCacheHit(cx, obj, obj2, entry);
if (!NativeGet(cx, obj, obj2, entry->prop, 0, vp))
@ -491,8 +491,8 @@ AddOperation(JSContext *cx, const Value &lhs, const Value &rhs, Value *res)
{
RootedValue lval_(cx, lhs);
RootedValue rval_(cx, rhs);
Value &lval = lval_.reference();
Value &rval = rval_.reference();
Value &lval = lval_.get();
Value &rval = rval_.get();
/*
* If either operand is an object, any non-integer result must be
@ -548,7 +548,7 @@ SubOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *res)
if (!ToNumber(cx, lhs, &d1) || !ToNumber(cx, rhs, &d2))
return false;
double d = d1 - d2;
if (!res->setNumber(d) && !(lhs.value().isDouble() || rhs.value().isDouble()))
if (!res->setNumber(d) && !(lhs.get().isDouble() || rhs.get().isDouble()))
types::TypeScript::MonitorOverflow(cx);
return true;
}
@ -560,7 +560,7 @@ MulOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *res)
if (!ToNumber(cx, lhs, &d1) || !ToNumber(cx, rhs, &d2))
return false;
double d = d1 * d2;
if (!res->setNumber(d) && !(lhs.value().isDouble() || rhs.value().isDouble()))
if (!res->setNumber(d) && !(lhs.get().isDouble() || rhs.get().isDouble()))
types::TypeScript::MonitorOverflow(cx);
return true;
}
@ -573,7 +573,7 @@ DivOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *res)
return false;
res->setNumber(NumberDiv(d1, d2));
if (d2 == 0 || (res->isDouble() && !(lhs.value().isDouble() || rhs.value().isDouble())))
if (d2 == 0 || (res->isDouble() && !(lhs.get().isDouble() || rhs.get().isDouble())))
types::TypeScript::MonitorOverflow(cx);
return true;
}
@ -582,8 +582,8 @@ static JS_ALWAYS_INLINE bool
ModOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *res)
{
int32_t l, r;
if (lhs.value().isInt32() && rhs.value().isInt32() &&
(l = lhs.value().toInt32()) >= 0 && (r = rhs.value().toInt32()) > 0) {
if (lhs.get().isInt32() && rhs.get().isInt32() &&
(l = lhs.get().toInt32()) >= 0 && (r = rhs.get().toInt32()) > 0) {
int32_t mod = l % r;
res->setInt32(mod);
return true;
@ -778,8 +778,8 @@ SetObjectElementOperation(JSContext *cx, Handle<JSObject*> obj, HandleId id, con
#define RELATIONAL_OP(OP) \
JS_BEGIN_MACRO \
RootedValue lvalRoot(cx, lhs), rvalRoot(cx, rhs); \
Value &lval = lvalRoot.reference(); \
Value &rval = rvalRoot.reference(); \
Value &lval = lvalRoot.get(); \
Value &rval = rvalRoot.get(); \
/* Optimize for two int-tagged operands (typical loop control). */ \
if (lval.isInt32() && rval.isInt32()) { \
*res = lval.toInt32() OP rval.toInt32(); \

View File

@ -246,7 +246,7 @@ class ForOfIterator {
{
RootedValue iterv(cx, iterable);
ok = ValueToIterator(cx, JSITER_FOR_OF, iterv.address());
iterator = ok ? &iterv.reference().toObject() : NULL;
iterator = ok ? &iterv.get().toObject() : NULL;
}
~ForOfIterator() {
@ -257,13 +257,13 @@ class ForOfIterator {
bool next() {
JS_ASSERT(!closed);
ok = ok && Next(cx, iterator, currentValue.address());
return ok && !currentValue.reference().isMagic(JS_NO_ITER_VALUE);
return ok && !currentValue.get().isMagic(JS_NO_ITER_VALUE);
}
Value &value() {
JS_ASSERT(ok);
JS_ASSERT(!closed);
return currentValue.reference();
return currentValue.get();
}
bool close() {

View File

@ -167,7 +167,7 @@ MarkSharpObjects(JSContext *cx, HandleObject obj, JSIdArray **idap, JSSharpInfo
JSSharpInfo sharpid;
JSSharpTable::Ptr p = map->table.lookup(obj);
if (!p) {
if (!map->table.put(obj.value(), sharpid))
if (!map->table.put(obj.get(), sharpid))
return false;
ida = JS_Enumerate(cx, obj);
@ -187,8 +187,8 @@ MarkSharpObjects(JSContext *cx, HandleObject obj, JSIdArray **idap, JSSharpInfo
continue;
bool hasGetter, hasSetter;
RootedValue valueRoot(cx), setterRoot(cx);
Value &value = valueRoot.reference();
Value &setter = setterRoot.reference();
Value &value = valueRoot.get();
Value &setter = setterRoot.get();
if (obj2->isNative()) {
const Shape *shape = (Shape *) prop;
hasGetter = shape->hasGetterValue();
@ -294,7 +294,7 @@ js_EnterSharpObject(JSContext *cx, HandleObject obj, JSIdArray **idap, bool *alr
*/
p = map->table.lookup(obj);
if (!p) {
if (!map->table.put(obj.value(), sharpid))
if (!map->table.put(obj.get(), sharpid))
goto bad;
goto out;
}
@ -4351,8 +4351,8 @@ js_FindClassObject(JSContext *cx, HandleObject start, JSProtoKey protoKey,
shape = (Shape *) prop;
if (shape->hasSlot()) {
v = pobj->nativeGetSlot(shape->slot());
if (v.reference().isPrimitive())
v.reference().setUndefined();
if (v.get().isPrimitive())
v.get().setUndefined();
}
}
vp.set(v);
@ -4780,7 +4780,7 @@ LookupPropertyWithFlagsInline(JSContext *cx, HandleObject obj, HandleId id, unsi
* read barrier.
*/
if (*propp && objp->isNative()) {
while ((proto = proto->getProto()) != objp.value())
while ((proto = proto->getProto()) != objp)
JS_ASSERT(proto);
}
#endif
@ -4947,7 +4947,7 @@ js::FindIdentifierBase(JSContext *cx, HandleObject scopeChain, HandlePropertyNam
{
RootedObject pobj(cx);
JSProperty *prop;
if (!LookupPropertyWithFlags(cx, obj, name.value(), cx->resolveFlags, &pobj, &prop))
if (!LookupPropertyWithFlags(cx, obj, name, cx->resolveFlags, &pobj, &prop))
return NULL;
if (prop) {
if (!pobj->isNative()) {
@ -5854,12 +5854,12 @@ js::FindClassPrototype(JSContext *cx, HandleObject scopeobj, JSProtoKey protoKey
return false;
if (IsFunctionObject(v)) {
JSObject *ctor = &v.reference().toObject();
JSObject *ctor = &v.get().toObject();
if (!ctor->getProperty(cx, cx->runtime->atomState.classPrototypeAtom, v.address()))
return false;
}
protop.set(v.reference().isObject() ? &v.reference().toObject() : NULL);
protop.set(v.get().isObject() ? &v.get().toObject() : NULL);
return true;
}

View File

@ -415,7 +415,7 @@ JO(JSContext *cx, HandleObject obj, StringifyContext *scx)
Value outputValue;
if (!obj->getGeneric(cx, id, &outputValue))
return false;
if (!PreprocessValue(cx, obj, id.reference(), &outputValue, scx))
if (!PreprocessValue(cx, obj, id.get(), &outputValue, scx))
return false;
if (IsFilteredValue(outputValue))
continue;
@ -586,7 +586,7 @@ js_Stringify(JSContext *cx, Value *vp, JSObject *replacer_, Value space_, String
{
RootedObject replacer(cx, replacer_);
RootedValue spaceRoot(cx, space_);
Value &space = spaceRoot.reference();
Value &space = spaceRoot.get();
/* Step 4. */
AutoIdVector propertyList(cx);
@ -734,7 +734,7 @@ js_Stringify(JSContext *cx, Value *vp, JSObject *replacer_, Value space_, String
if (!scx.init())
return false;
if (!PreprocessValue(cx, wrapper, emptyId.reference(), vp, &scx))
if (!PreprocessValue(cx, wrapper, emptyId.get(), vp, &scx))
return false;
if (IsFilteredValue(*vp))
return true;

View File

@ -791,7 +791,7 @@ ScriptedProxyHandler::getPropertyDescriptor(JSContext *cx, JSObject *proxy_, jsi
RootedValue fval(cx), value(cx);
return GetFundamentalTrap(cx, handler, ATOM(getPropertyDescriptor), fval.address()) &&
Trap1(cx, handler, fval, id, value.address()) &&
((value.reference().isUndefined() && IndicatePropertyNotFound(cx, desc)) ||
((value.get().isUndefined() && IndicatePropertyNotFound(cx, desc)) ||
(ReturnedValueMustNotBePrimitive(cx, proxy, ATOM(getPropertyDescriptor), value) &&
ParsePropertyDescriptorObject(cx, proxy, id, value, desc)));
}
@ -806,7 +806,7 @@ ScriptedProxyHandler::getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy_,
RootedValue fval(cx), value(cx);
return GetFundamentalTrap(cx, handler, ATOM(getOwnPropertyDescriptor), fval.address()) &&
Trap1(cx, handler, fval, id, value.address()) &&
((value.reference().isUndefined() && IndicatePropertyNotFound(cx, desc)) ||
((value.get().isUndefined() && IndicatePropertyNotFound(cx, desc)) ||
(ReturnedValueMustNotBePrimitive(cx, proxy, ATOM(getPropertyDescriptor), value) &&
ParsePropertyDescriptorObject(cx, proxy, id, value, desc)));
}

View File

@ -322,7 +322,7 @@ ArrayBufferObject::obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId i
return false;
if (*propp != NULL) {
if (objp.value() == delegate)
if (objp == delegate)
objp.set(obj);
return true;
}
@ -363,7 +363,7 @@ ArrayBufferObject::obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t i
return false;
if (*propp != NULL) {
if (objp.value() == delegate)
if (objp == delegate)
objp.set(obj);
return true;
}

View File

@ -1666,11 +1666,11 @@ GetXMLSetting(JSContext *cx, const char *name, jsval *vp)
RootedObject null(cx);
if (!js_FindClassObject(cx, null, JSProto_XML, &v))
return JS_FALSE;
if (v.reference().isPrimitive() || !v.reference().toObject().isFunction()) {
if (v.get().isPrimitive() || !v.get().toObject().isFunction()) {
*vp = JSVAL_VOID;
return JS_TRUE;
}
return JS_GetProperty(cx, &v.reference().toObject(), name, vp);
return JS_GetProperty(cx, &v.get().toObject(), name, vp);
}
static JSBool

View File

@ -5165,7 +5165,7 @@ mjit::Compiler::jsop_getprop_dispatch(PropertyName *name)
return false;
RootedId id(cx, NameToId(name));
if (id.reference() != types::MakeTypeId(cx, id))
if (id.get() != types::MakeTypeId(cx, id))
return false;
types::TypeSet *pushedTypes = pushedTypeSet(0);

View File

@ -639,7 +639,7 @@ Debugger::wrapEnvironment(JSContext *cx, Handle<Env*> env, Value *rval)
return false;
envobj->setPrivate(env);
envobj->setReservedSlot(JSSLOT_DEBUGENV_OWNER, ObjectValue(*object));
if (!environments.relookupOrAdd(p, env.value(), envobj)) {
if (!environments.relookupOrAdd(p, env, envobj)) {
js_ReportOutOfMemory(cx);
return false;
}
@ -1816,7 +1816,7 @@ Debugger::construct(JSContext *cx, unsigned argc, Value *vp)
for (unsigned slot = JSSLOT_DEBUG_PROTO_START; slot < JSSLOT_DEBUG_PROTO_STOP; slot++)
obj->setReservedSlot(slot, proto->getReservedSlot(slot));
Debugger *dbg = cx->new_<Debugger>(cx, obj.reference());
Debugger *dbg = cx->new_<Debugger>(cx, obj.get());
if (!dbg)
return false;
obj->setPrivate(dbg);
@ -3229,7 +3229,7 @@ DebuggerFrame_getArguments(JSContext *cx, unsigned argc, Value *vp)
id = INT_TO_JSID(i);
if (!getobj ||
!DefineNativeProperty(cx, argsobj, id, UndefinedValue(),
JS_DATA_TO_FUNC_PTR(PropertyOp, getobj.reference()), NULL,
JS_DATA_TO_FUNC_PTR(PropertyOp, getobj.get()), NULL,
JSPROP_ENUMERATE | JSPROP_SHARED | JSPROP_GETTER, 0, 0))
{
return false;

View File

@ -395,7 +395,7 @@ GlobalObject::createBlankPrototype(JSContext *cx, Class *clasp)
if (!objectProto)
return NULL;
return CreateBlankProto(cx, clasp, *objectProto, *self.reference());
return CreateBlankProto(cx, clasp, *objectProto, *self.get());
}
JSObject *

View File

@ -498,7 +498,7 @@ js::GetOwnProperty(JSContext *cx, Handle<ObjectImpl*> obj, PropertyId pid_, unsi
Rooted<PropertyId> pid(cx, pid_);
if (static_cast<JSObject *>(obj.value())->isProxy()) {
if (static_cast<JSObject *>(obj.get())->isProxy()) {
MOZ_NOT_REACHED("NYI: proxy [[GetOwnProperty]]");
return false;
}
@ -509,8 +509,8 @@ js::GetOwnProperty(JSContext *cx, Handle<ObjectImpl*> obj, PropertyId pid_, unsi
Class *clasp = obj->getClass();
JSResolveOp resolve = clasp->resolve;
if (resolve != JS_ResolveStub) {
Rooted<jsid> id(cx, pid.reference().asId());
Rooted<JSObject*> robj(cx, static_cast<JSObject*>(obj.value()));
Rooted<jsid> id(cx, pid.get().asId());
Rooted<JSObject*> robj(cx, static_cast<JSObject*>(obj.get()));
if (clasp->flags & JSCLASS_NEW_RESOLVE) {
Rooted<JSObject*> obj2(cx, NULL);
JSNewResolveOp op = reinterpret_cast<JSNewResolveOp>(resolve);

View File

@ -78,7 +78,7 @@ RegExpObjectBuilder::build(HandleAtom source, RegExpFlag flags)
if (!getOrCreate())
return NULL;
return reobj_->init(cx, source, flags) ? reobj_.raw() : NULL;
return reobj_->init(cx, source, flags) ? reobj_.get() : NULL;
}
RegExpObject *

View File

@ -1437,7 +1437,7 @@ DebugScopeObject::create(JSContext *cx, ScopeObject &scope, HandleObject enclosi
return NULL;
JS_ASSERT(!enclosing->isScope());
SetProxyExtra(obj, ENCLOSING_EXTRA, ObjectValue(*enclosing.value()));
SetProxyExtra(obj, ENCLOSING_EXTRA, ObjectValue(*enclosing));
return &obj->asDebugScope();
}