Closed zhouhanseng closed 3 years ago
Updated the test.
Updated the test.
Excited about this. I'll review the change soon and get it merged. I guess this will be a new major version for safety.
Is this PR okay?
I want to give it some detailed testing before I land it, but it looks good at a glance. I also need to figure out if it requires a major version bump or not. Sorry for the delay, just not got a bunch of free time right now. It's still on my todo list, and I really appreciate the work you've put in.
Sorry I still haven't gotten to this. It's still on my TODO list, I've just hit a bunch of deadlines.
Don't worry about the conflicts, I'll solve those
@zhouhanseng I finally found time to review this. Excellent work. I'm going to pick up a couple of other bug reports and publish a new version.
hi @zhouhanseng, can a ReadWrite tx assign to a ReadOnly tx? That is a safe action.
Store names should also come in the check:
The type checking rule should be:
B = A
should pass, A = B
should errorB = A
should pass, A = B
should error@Jack-Works No, it can't assign.
@zhouhanseng it should be, it's runtime safe so it should pass the compiler.
Fixes https://github.com/jakearchibald/idb/issues/140
Add type check for transaction's mode, it is impossible to pass a
readonly
transaction to a function that requires areadwrite
transaction.Exclude
add()
,put()
,delete()
,clear()
fromobjectstore
created byreadonly
transaction. KeepcreateIndex()
only inobjectstore
created byversionchange
transaction.