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
Advances the cursor to the next [=object-store/record=] in range matching
4438
4440
or after |key| and |primaryKey|. Throws an "{{InvalidAccessError}}" {{DOMException}}
4439
4441
if the [=cursor/source=] is not an [=/index=].
4442
+
4443
+
: |cursor| . {{IDBCursor/close()|close}}()
4444
+
::
4445
+
Signals that the cursor is no longer needed, and that any associated resources can be released.
4440
4446
</dl>
4441
4447
</div>
4442
4448
@@ -4457,9 +4463,9 @@ invoked, must run these steps:
4457
4463
1. If **this**'s [=cursor/source=] or [=effective object
4458
4464
store=] has been deleted, [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4459
4465
4460
-
1. If **this**'s [=cursor/got value flag=] is false, indicating that
4461
-
the cursor is being iterated or has iterated past its end,
4462
-
[=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4466
+
1. If **this**'s [=cursor/got value flag=] is false
4467
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4468
+
then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4463
4469
4464
4470
1. Set **this**'s [=cursor/got value flag=] to false.
4465
4471
@@ -4499,9 +4505,9 @@ invoked, must run these steps:
4499
4505
[=effective object store=] has been deleted, [=throw=] an
4500
4506
"{{InvalidStateError}}" {{DOMException}}.
4501
4507
4502
-
1. If **this**'s [=cursor/got value flag=] is false, indicating that
4503
-
the cursor is being iterated or has iterated past its end,
4504
-
[=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4508
+
1. If **this**'s [=cursor/got value flag=] is false
4509
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4510
+
then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4505
4511
4506
4512
1. If |key| is given, then:
4507
4513
@@ -4564,9 +4570,9 @@ The <dfn method for=IDBCursor>continuePrimaryKey(|key|,
4564
4570
1. If **this**'s [=cursor/direction=] is not {{"next"}} or {{"prev"}},
4565
4571
[=throw=] an "{{InvalidAccessError}}" {{DOMException}}.
4566
4572
4567
-
1. If **this**'s [=cursor/got value flag=] is false, indicating that
4568
-
the cursor is being iterated or has iterated past its end,
4569
-
[=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4573
+
1. If **this**'s [=cursor/got value flag=] is false
4574
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4575
+
then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4570
4576
4571
4577
1. Let |r| be the result of running [=convert a value to
4572
4578
a key=] with |key|. Rethrow any exceptions.
@@ -4625,6 +4631,39 @@ The <dfn method for=IDBCursor>continuePrimaryKey(|key|,
4625
4631
flag=] has been set to false.
4626
4632
</aside>
4627
4633
4634
+
<div class=algorithm>
4635
+
4636
+
The <dfn method for=IDBCursor>close()</dfn> method, when invoked, must run these steps:
4637
+
4638
+
1. Let |transaction| be **this**'s [=cursor/transaction=].
4639
+
4640
+
1. If |transaction|'s [=transaction/state=] is not [=transaction/active=], then [=throw=] a "{{TransactionInactiveError}}" {{DOMException}}.
4641
+
4642
+
1. If **this**'s [=cursor/source=] or [=effective object store=] has been deleted, then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4643
+
4644
+
1. If **this**'s [=cursor/got value flag=] is false
4645
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4646
+
then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4647
+
4648
+
1. Set **this**'s [=cursor/got value flag=] to false.
4649
+
4650
+
1. Set **this**'s [=cursor/key=] to undefined.
4651
+
4652
+
1. If **this**'s [=cursor/source=] is an [=/index=], then set **this**'s [=object store position=] to undefined.
4653
+
4654
+
1. If **this**'s [=cursor/key only flag=] is false, then set **this**'s [=cursor/value=] to undefined.
4655
+
4656
+
</div>
4657
+
4658
+
<aside class=note>
4659
+
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.
4660
+
</aside>
4661
+
4662
+
<aside class=advisement>
4663
+
🚧
4664
+
The {{IDBCursor/close()}} method is new in this edition.
4665
+
🚧
4666
+
</aside>
4628
4667
4629
4668
4630
4669
<div class=note>
@@ -4671,9 +4710,9 @@ invoked, must run these steps:
4671
4710
1. If **this**'s [=cursor/source=] or [=effective object
4672
4711
store=] has been deleted, [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4673
4712
4674
-
1. If **this**'s [=cursor/got value flag=] is false, indicating that
4675
-
the cursor is being iterated or has iterated past its end,
4676
-
[=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4713
+
1. If **this**'s [=cursor/got value flag=] is false
4714
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4715
+
then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4677
4716
4678
4717
1. If **this**'s [=cursor/key only flag=] is true, [=throw=] an
4679
4718
"{{InvalidStateError}}" {{DOMException}}.
@@ -4737,9 +4776,9 @@ must run these steps:
4737
4776
1. If **this**'s [=cursor/source=] or [=effective object
4738
4777
store=] has been deleted, [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4739
4778
4740
-
1. If **this**'s [=cursor/got value flag=] is false, indicating that
4741
-
the cursor is being iterated or has iterated past its end,
4742
-
[=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4779
+
1. If **this**'s [=cursor/got value flag=] is false
4780
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4781
+
then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4743
4782
4744
4783
1. If **this**'s [=cursor/key only flag=] is true, [=throw=] an
4745
4784
"{{InvalidStateError}}" {{DOMException}}.
@@ -6815,6 +6854,7 @@ For the revision history of the second edition, see [that document's Revision Hi
6815
6854
* Removed handling for nonstandard `lastModifiedDate` property of {{File}} objects. ([Issue #215](https://github.com/w3c/IndexedDB/issues/215))
0 commit comments