[Webkit-unassigned] [Bug 62288] IndexedDB createObjectStore should throw if key path contains a space

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 20 05:57:52 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=62288





--- Comment #9 from Hans Wennborg <hans at chromium.org>  2011-06-20 05:57:51 PST ---
View in context: https://bugs.webkit.org/attachment.cgi?id=97785&action=review

> LayoutTests/storage/indexeddb/keypath-basics.html:49
> +    testKeyPath = [null, undefined, '', 'foo', 'foo.bar.baz'];

maybe rename testKeyPath to testKeyPaths? (here, and in a couple of more places below)

> Source/WebCore/storage/IDBDatabase.cpp:87
> +    IDBParseKeyPath(keyPath, keyPathElements, error);

could you factor this out into a function such as "bool IDBKeyPathIsValid(const String& path)" in IDBKeyPath.cpp/h?

> Source/WebCore/storage/IDBKeyPath.h:40
> +        IsNamed

There doesn't seem to be any point in keeping this enum around if an IDBKeyPathElement is always a name.

> Source/WebCore/storage/IDBObjectStore.cpp:138
> +    }

see comment in IDBDatabase.cpp. It would be nice if we could just have:

if (keyPath.isNull() || !IDBIsValidKeyPath(keyPath)) {
    ec = ...;
    return 0;
}

> Source/WebKit/chromium/tests/IDBKeyPathTest.cpp:60
>              ASSERT_TRUE(false) << "Invalid IDBKeyPathElement type";

this loop should be simpler now that an element is always a name, right?


Thanks for working on this!

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list