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
4465
4473
"{{InvalidStateError}}" {{DOMException}}.
4466
4474
4467
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4468
-
the cursor is being iterated or has iterated past its end,
4469
-
[=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4475
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4476
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4477
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4470
4478
4471
4479
1. If |key| is given, then:
4472
4480
@@ -4526,9 +4534,9 @@ The <dfn method for=IDBCursor>continuePrimaryKey(|key|, |primaryKey|)</dfn> meth
4526
4534
1. If [=/this=]'s [=cursor/direction=] is not "{{IDBCursorDirection/next}}" or "{{IDBCursorDirection/prev}}",
4527
4535
[=exception/throw=] an "{{InvalidAccessError}}" {{DOMException}}.
4528
4536
4529
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4530
-
the cursor is being iterated or has iterated past its end,
4531
-
[=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4537
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4538
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4539
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4532
4540
4533
4541
1. Let |r| be the result of [=/converting a value to
4534
4542
a key=] with |key|. Rethrow any exceptions.
@@ -4585,6 +4593,39 @@ The <dfn method for=IDBCursor>continuePrimaryKey(|key|, |primaryKey|)</dfn> meth
4585
4593
flag=] has been set to false.
4586
4594
</aside>
4587
4595
4596
+
<div algorithm>
4597
+
4598
+
The <dfn method for=IDBCursor>close()</dfn> method steps are:
4599
+
4600
+
1. Let |transaction| be [=/this=]'s [=cursor/transaction=].
4601
+
4602
+
1. If |transaction|'s [=transaction/state=] is not [=transaction/active=], then [=exception/throw=] a "{{TransactionInactiveError}}" {{DOMException}}.
4603
+
4604
+
1. If [=/this=]'s [=cursor/source=] or [=cursor/effective object store=] has been deleted, then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4605
+
4606
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4607
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4608
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4609
+
4610
+
1. Set [=/this=]'s [=cursor/got value flag=] to false.
4611
+
4612
+
1. Set [=/this=]'s [=cursor/key=] to undefined.
4613
+
4614
+
1. If [=/this=]'s [=cursor/source=] is an [=/index=], then set [=/this=]'s [=cursor/object store position=] to undefined.
4615
+
4616
+
1. If [=/this=]'s [=cursor/key only flag=] is false, then set [=/this=]'s [=cursor/value=] to undefined.
4617
+
4618
+
</div>
4619
+
4620
+
<aside class=note>
4621
+
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.
4622
+
</aside>
4623
+
4624
+
<aside class=advisement>
4625
+
🚧
4626
+
The {{IDBCursor/close()}} method is new in this edition.
1. If [=/this=]'s [=cursor/source=] or [=cursor/effective object
4690
4731
store=] has been deleted, [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4691
4732
4692
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4693
-
the cursor is being iterated or has iterated past its end,
4694
-
[=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4733
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4734
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4735
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4695
4736
4696
4737
1. If [=/this=]'s [=cursor/key only flag=] is true, [=exception/throw=] an
4697
4738
"{{InvalidStateError}}" {{DOMException}}.
@@ -6805,6 +6846,7 @@ For the revision history of the second edition, see [that document's Revision Hi
6805
6846
* 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