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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 19 17:07:14 PDT 2011


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





--- Comment #22 from Kentaro Hara <haraken at google.com>  2011-07-19 17:07:13 PST ---
> This is my best understanding...
> 
> (1) createObjectStore(): should throw TypeError (this should be handled in the IDL, no need for C++ code)
> 
> (2) createObjectStore(null): this should behave identically to createObjectStore("null"). Yeah, I'm not happy about it either.
> 
> (3) createObjectStore(undefined): should throw TypeError
> 
> (4) createIndex("name", {keyPath: undefined}): should throw NON_TRANSIENT_ERR
> 
> (5) createIndex("name", {keyPath: null}): should throw NON_TRANSIENT_ERR

Thank you very much for the comments. I agree with (4) and (5), but still feel some suspicion on (1), (2) and (3). 

- At any rate, the essential problem is the lack of the specification. We need to interpret it as appropriately as possible. 

- As for (2), I think that null and "null" are definitely different things. "null" is a valid key-path but null is not a valid key-path. 

- In my opinion, the results for (1), (2) and (3) should be identical (, although throwing TypeError in case of (2) is difficult from the perspective of the current implementation).

- Why do you consider that not NON_TRANSIENT_ERR but TypeError should be thrown in case of (1) and (3)? Are there any other places that are throwing TypeError when a nullable argument is passed? According to the specification, other APIs are throwing a kind of database exception when the nullable argument is passed, for example, bound() throws DATA_ERR, lowerBound() throws DATA_ERR, cmp() throws NON_TRANSIENT_ERR, when null or undefined is passed. 

- In summary...

The current specification: "If keyPath is an Array and any items in the array is not a valid key path, or if keyPath is a string and is not a valid key path, or if keyPath is Array and the multientry property in the optionalParameters is true, then a NON_TRANSIENT_ERR error must be thrown. "

Expected specification in my opinion: "If keyPath is an Array and any items in the array is not a valid key path, or if keyPath is not a valid key path, or if keyPath is Array and the multientry property in the optionalParameters is true, then a NON_TRANSIENT_ERR error must be thrown. "


However, if you would still say that the behaviors you indicated above are desirable, I am willing to follow your idea.

-- 
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