Changeset 158940 in webkit


Ignore:
Timestamp:
Nov 8, 2013 12:27:55 PM (10 years ago)
Author:
oliver@apple.com
Message:

Fix minor (unobservable) bug in ArrayIterator::next()
https://bugs.webkit.org/show_bug.cgi?id=124061

Reviewed by Beth Dakin.

I noticed this while reading the array iterator code. Due to how
ArrayIterator::next() and our enumeration behaviour is implemented
this is not actually a code path that can be hit. But in order to
future proof this it should be correct.

  • runtime/JSArrayIterator.cpp:

(JSC::arrayIteratorNext):

Location:
trunk/Source/JavaScriptCore
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r158937 r158940  
     12013-11-08  Oliver Hunt  <oliver@apple.com>
     2
     3        Fix minor (unobservable) bug in ArrayIterator::next()
     4        https://bugs.webkit.org/show_bug.cgi?id=124061
     5
     6        Reviewed by Beth Dakin.
     7
     8        I noticed this while reading the array iterator code.  Due to how
     9        ArrayIterator::next() and our enumeration behaviour is implemented
     10        this is not actually a code path that can be hit.  But in order to
     11        future proof this it should be correct.
     12       
     13        * runtime/JSArrayIterator.cpp:
     14        (JSC::arrayIteratorNext):
     15
    1162013-11-08  Mark Lam  <mark.lam@apple.com>
    217
  • trunk/Source/JavaScriptCore/runtime/JSArrayIterator.cpp

    r158793 r158940  
    101101{
    102102    JSArrayIterator* iterator = jsDynamicCast<JSArrayIterator*>(callFrame->thisValue());
    103     if (!iterator)
    104         throwTypeError(callFrame, ASCIILiteral("Cannot call ArrayIterator.next() on a non-ArrayIterator object"));
     103    if (!iterator) {
     104        ASSERT_NOT_REACHED();
     105        return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot call ArrayIterator.next() on a non-ArrayIterator object")));
     106    }
    105107    JSObject* iteratedObject = iterator->iteratedObject();
    106108    size_t index = iterator->nextIndex();
Note: See TracChangeset for help on using the changeset viewer.