Skip to content

Uint8Array.subarray problem #476

Description

@RuralHunter

The result of subarray of another subarray is wrong. Test code:

            var arr = new Uint8Array([1,2,3,4,5,6,7,8,9,10]);
            var sub1 =arr.subarray(5,10);
            var sub1a=[];
            for(var i=0;i<sub1.length;i++)
                sub1a.push(sub1[i]);
            console.log('sub1='+sub1a);
            
            var sub2 =sub1.subarray(0,3);
            var sub2a=[];
            for(var i=0;i<sub2.length;i++)
                sub2a.push(sub2[i]);
            console.log('sub2='+sub2a);

In htmlunit, the output is:

sub1=6,7,8,9,10
sub2=1,2,3

The correct result or the result from real browser is:

sub1=6,7,8,9,10
sub2=6,7,8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions