Fixed NodeList::item() calling a 1-indexed array reference (should be 0-indexed according to DOM spec.)

#17 Declined
Repository
timbrody
Branch
default
Repository
shlomif
Branch
default
Author
  1. Tim Brody
Reviewers
Description

Seems to be a long-standing bug that I've never noticed before.

See also http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-536297177.

Comments (1)

  1. Shlomi Fish repo owner

    Hi Tim,

    this would be a welcome bug fix. However, the patch suffers from the following issues:

    1. No explicit return on the "item()" method. See: http://perl-begin.org/tutorials/bad-elements/#explicit_return .

    2. You're using a mixture of CORE::shift and «my ($pos) = @_;». It should just be «my ($self, $pos) = @_;».

    3. You need to add some tests in t/*.t.

    For more information, see:

    http://www.shlomifish.org/open-source/resources/how-to-contribute-to-my-projects/

    Regards,

    -- Shlomi Fish