Bug 877281 part 5. Add a set() method to Rooted. r=terrence

This commit is contained in:
Boris Zbarsky 2013-06-07 22:45:45 -04:00
parent 19af9fb8fa
commit aec6c97d07

View File

@ -579,6 +579,11 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
return ptr;
}
void set(T value) {
JS_ASSERT(!js::RootMethods<T>::poisoned(value));
ptr = value;
}
bool operator!=(const T &other) { return ptr != other; }
bool operator==(const T &other) { return ptr == other; }