mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 704369: Factor EmitTree to avoid recursion limit. (r=Waldo)
This commit is contained in:
parent
24850ce76d
commit
718eefc6c5
File diff suppressed because it is too large
Load Diff
@ -118,10 +118,34 @@ class AutoNamespaceArray : protected AutoGCRooter {
|
||||
JSXMLArray<JSObject> array;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class AutoPtr
|
||||
{
|
||||
JSContext *cx;
|
||||
T *value;
|
||||
|
||||
AutoPtr(const AutoPtr &other) MOZ_DELETE;
|
||||
|
||||
public:
|
||||
explicit AutoPtr(JSContext *cx) : cx(cx), value(NULL) {}
|
||||
~AutoPtr() {
|
||||
cx->delete_<T>(value);
|
||||
}
|
||||
|
||||
void operator=(T *ptr) { value = ptr; }
|
||||
|
||||
typedef void ***** ConvertibleToBool;
|
||||
operator ConvertibleToBool() const { return (ConvertibleToBool) value; }
|
||||
|
||||
const T *operator->() const { return value; }
|
||||
T *operator->() { return value; }
|
||||
|
||||
T *get() { return value; }
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
class CompartmentChecker
|
||||
{
|
||||
private:
|
||||
JSContext *context;
|
||||
JSCompartment *compartment;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user