Bug 952873 part 1. Rename the cx member of ForOfIterator to cx_ instead. r=jorendorff

This commit is contained in:
Boris Zbarsky 2014-01-28 16:14:47 -08:00
parent 34881e8914
commit f719c525e2
2 changed files with 4 additions and 2 deletions

View File

@ -1271,6 +1271,7 @@ const Class StopIterationObject::class_ = {
bool bool
ForOfIterator::init(HandleValue iterable) ForOfIterator::init(HandleValue iterable)
{ {
JSContext *cx = cx_;
RootedObject iterableObj(cx, ToObject(cx, iterable)); RootedObject iterableObj(cx, ToObject(cx, iterable));
if (!iterableObj) if (!iterableObj)
return false; return false;
@ -1313,6 +1314,7 @@ ForOfIterator::next(MutableHandleValue vp, bool *done)
{ {
JS_ASSERT(iterator); JS_ASSERT(iterator);
JSContext *cx = cx_;
RootedValue method(cx); RootedValue method(cx);
if (!JSObject::getProperty(cx, iterator, iterator, cx->names().next, &method)) if (!JSObject::getProperty(cx, iterator, iterator, cx->names().next, &method))
return false; return false;

View File

@ -239,14 +239,14 @@ namespace js {
class ForOfIterator class ForOfIterator
{ {
private: private:
JSContext *cx; JSContext *cx_;
RootedObject iterator; RootedObject iterator;
ForOfIterator(const ForOfIterator &) MOZ_DELETE; ForOfIterator(const ForOfIterator &) MOZ_DELETE;
ForOfIterator &operator=(const ForOfIterator &) MOZ_DELETE; ForOfIterator &operator=(const ForOfIterator &) MOZ_DELETE;
public: public:
ForOfIterator(JSContext *cx) : cx(cx), iterator(cx) { } ForOfIterator(JSContext *cx) : cx_(cx), iterator(cx) { }
bool init(HandleValue iterable); bool init(HandleValue iterable);
bool next(MutableHandleValue val, bool *done); bool next(MutableHandleValue val, bool *done);