[Bug 27712] New: IndexedDB: Array comparison algorithm doesn't handle empty arrays

https://www.w3.org/Bugs/Public/show_bug.cgi?id=27712

            Bug ID: 27712
           Summary: IndexedDB: Array comparison algorithm doesn't handle
                    empty arrays
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Indexed Database API
          Assignee: dave.null@w3.org
          Reporter: n210241048576@gmail.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-webapps@w3.org

The array comparison algorithm says to compare the first element of the arrays
before checking the length, which means that it doesn't work for empty arrays,
despite empty arrays being valid keys.


Let A be the first Array value and B be the second Array value.
Let length be the lesser of A's length and B's length.
Let i be 0.
If the ith value of A is less than the ith value of B, then A is less than B.
Skip the remaining steps.
If the ith value of A is greater than the ith value of B, then A is greater
than B. Skip the remaining steps.
Increase i by 1.
If i is not equal to length, go back to step 4. Otherwise continue to next
step.
If A's length is less than B's length, then A is less than B. If A's length is
greater than B's length, then A is greater than B. Otherwise A and B are equal.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Sunday, 28 December 2014 19:58:14 UTC