Arbit - project tracking

Dwoo

#37: isArray wrong check

Issue revisions

  • closed by Franco Zeoli at 2009-A-16 17:32
Type bug bug
State closed closed
Priority high high
Resolution fixed fixed
Assigned to Jordi Boggiano
Scheduled for 1.2.0
Affected versions
Affected components Core
Last change Sunday 16 August 2009 17:32:16 UTC by Franco Zeoli

The method isArray of the class Dwoo checks if the given variable implements Iterator or ArrayAccess, but there is another interface that is used to iterate objects: IteratorAggregate, leaving the objects that implement it as non-arrays. Both Iterator and IteratorAggregate extends Traversable so the isArray method should check if the variable implements Traversable and ArrayAccess

  • Jordi Boggiano at Monday 12 October 2009 18:22:07 UTC

    Applied in changeset r284.

  • emanuel at Monday 22 March 2010 13:15:19 UTC

    I think that checking for ArrayAccess is wrong.

  • Jordi Boggiano at Monday 22 March 2010 14:25:58 UTC

    Please check the implementation in trunk and/or tests in CoreTests, it now checks for Traversable when it wants to iterate, and ArrayAccess in the cases where it needs to access the object as an array, which should be good.