Chan Le
Chan Le

Reputation: 2204

IndexedDB Transaction constant in Google Chrome

the specs:

const unsigned short READ_ONLY = 0;
const unsigned short READ_WRITE = 1;

checking an webkitIDBTransaction.__ proto __ in google chrome's console:

READ_ONLY: 1
READ_WRITE: 0

I wonder if google chrome mis-implementing the indexeddb specs here?

Upvotes: 0

Views: 218

Answers (1)

buley
buley

Reputation: 29208

IDBTransaction should have those properties directly, not inherit them via its prototype.

I cannot speak to previous versions but the webkitIDBTransaction.__proto__ object doesn't have READ_WRITE or any other transaction state constants today so it's possible the object you were looking at was the wrong prototype or, as you say, its prototype (which would be what though?) was incorrectly implemented.

In any case, these constants are fine in recent builds of Chrome:

console.log( webkitIDBTransaction.READ_ONLY );
> 0

console.log( webkitIDBTransaction.READ_WRITE );
> 1

Upvotes: 1

Related Questions