You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[=cursor/effective object store=] has been deleted, [=exception/throw=] an
4461
4469
"{{InvalidStateError}}" {{DOMException}}.
4462
4470
4463
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4464
-
the cursor is being iterated or has iterated past its end,
4465
-
[=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4471
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4472
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4473
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4466
4474
4467
4475
1. If |key| is given, then:
4468
4476
@@ -4522,9 +4530,9 @@ The <dfn method for=IDBCursor>continuePrimaryKey(|key|, |primaryKey|)</dfn> meth
4522
4530
1. If [=/this=]'s [=cursor/direction=] is not "{{IDBCursorDirection/next}}" or "{{IDBCursorDirection/prev}}",
4523
4531
[=exception/throw=] an "{{InvalidAccessError}}" {{DOMException}}.
4524
4532
4525
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4526
-
the cursor is being iterated or has iterated past its end,
4527
-
[=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4533
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4534
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4535
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4528
4536
4529
4537
1. Let |r| be the result of [=/converting a value to
4530
4538
a key=] with |key|. Rethrow any exceptions.
@@ -4581,6 +4589,39 @@ The <dfn method for=IDBCursor>continuePrimaryKey(|key|, |primaryKey|)</dfn> meth
4581
4589
flag=] has been set to false.
4582
4590
</aside>
4583
4591
4592
+
<div algorithm>
4593
+
4594
+
The <dfn method for=IDBCursor>close()</dfn> method steps are:
4595
+
4596
+
1. Let |transaction| be [=/this=]'s [=cursor/transaction=].
4597
+
4598
+
1. If |transaction|'s [=transaction/state=] is not [=transaction/active=], then [=exception/throw=] a "{{TransactionInactiveError}}" {{DOMException}}.
4599
+
4600
+
1. If [=/this=]'s [=cursor/source=] or [=cursor/effective object store=] has been deleted, then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4601
+
4602
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4603
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4604
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4605
+
4606
+
1. Set [=/this=]'s [=cursor/got value flag=] to false.
4607
+
4608
+
1. Set [=/this=]'s [=cursor/key=] to undefined.
4609
+
4610
+
1. If [=/this=]'s [=cursor/source=] is an [=/index=], then set [=/this=]'s [=cursor/object store position=] to undefined.
4611
+
4612
+
1. If [=/this=]'s [=cursor/key only flag=] is false, then set [=/this=]'s [=cursor/value=] to undefined.
4613
+
4614
+
</div>
4615
+
4616
+
<aside class=note>
4617
+
The {{IDBCursor/close()}} method allows web applications to hint to the user agent that the cursor will no longer be iterated, and that any state associated with the cursor can be discarded.
4618
+
</aside>
4619
+
4620
+
<aside class=advisement>
4621
+
🚧
4622
+
The {{IDBCursor/close()}} method is new in this edition.
1. If [=/this=]'s [=cursor/source=] or [=cursor/effective object
4686
4727
store=] has been deleted, [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4687
4728
4688
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4689
-
the cursor is being iterated or has iterated past its end,
4690
-
[=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4729
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4730
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4731
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4691
4732
4692
4733
1. If [=/this=]'s [=cursor/key only flag=] is true, [=exception/throw=] an
4693
4734
"{{InvalidStateError}}" {{DOMException}}.
@@ -6800,6 +6841,7 @@ For the revision history of the second edition, see [that document's Revision Hi
6800
6841
* Specified [[#transaction-scheduling]] more precisely and disallow starting read/write transactions while read-only transactions with overlapping scope are running. ([Issue #253](https://github.com/w3c/IndexedDB/issues/253))
0 commit comments