Google Chrome 中的 IndexedDB 事务常量
规范:
const unsigned short READ_ONLY = 0;
const unsigned short READ_WRITE = 1;
在 google chrome 控制台中检查 webkitIDBTransaction.__ proto __
:
READ_ONLY: 1
READ_WRITE: 0
我想知道 google chrome 是否在这里错误地实现了 indexeddb 规范?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IDBTransaction 应该直接拥有这些属性,而不是通过其原型继承它们。
我无法谈论以前的版本,但是
webkitIDBTransaction.__proto__
对象今天没有 READ_WRITE 或任何其他事务状态常量,因此您正在查看的对象可能是错误的原型,或者正如您所说,它的原型(这会是什么?)没有正确实现。无论如何,这些常量在 Chrome 的最新版本中都很好:
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: