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
[=effective object store=] has been deleted, [=throw=] an
4440
4448
"{{InvalidStateError}}" {{DOMException}}.
4441
4449
4442
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4443
-
the cursor is being iterated or has iterated past its end,
4444
-
[=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4450
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4451
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4452
+
then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4445
4453
4446
4454
1. If |key| is given, then:
4447
4455
@@ -4501,9 +4509,9 @@ The <dfn method for=IDBCursor>continuePrimaryKey(|key|, |primaryKey|)</dfn> meth
4501
4509
1. If [=/this=]'s [=cursor/direction=] is not {{"next"}} or {{"prev"}},
4502
4510
[=throw=] an "{{InvalidAccessError}}" {{DOMException}}.
4503
4511
4504
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4505
-
the cursor is being iterated or has iterated past its end,
4506
-
[=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4512
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4513
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4514
+
then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4507
4515
4508
4516
1. Let |r| be the result of running [=convert a value to
4509
4517
a key=] with |key|. Rethrow any exceptions.
@@ -4560,6 +4568,39 @@ The <dfn method for=IDBCursor>continuePrimaryKey(|key|, |primaryKey|)</dfn> meth
4560
4568
flag=] has been set to false.
4561
4569
</aside>
4562
4570
4571
+
<div class=algorithm>
4572
+
4573
+
The <dfn method for=IDBCursor>close()</dfn> method steps are:
4574
+
4575
+
1. Let |transaction| be [=/this=]'s [=cursor/transaction=].
4576
+
4577
+
1. If |transaction|'s [=transaction/state=] is not [=transaction/active=], then [=throw=] a "{{TransactionInactiveError}}" {{DOMException}}.
4578
+
4579
+
1. If [=/this=]'s [=cursor/source=] or [=effective object store=] has been deleted, then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4580
+
4581
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4582
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4583
+
then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4584
+
4585
+
1. Set [=/this=]'s [=cursor/got value flag=] to false.
4586
+
4587
+
1. Set [=/this=]'s [=cursor/key=] to undefined.
4588
+
4589
+
1. If [=/this=]'s [=cursor/source=] is an [=/index=], then set [=/this=]'s [=object store position=] to undefined.
4590
+
4591
+
1. If [=/this=]'s [=cursor/key only flag=] is false, then set [=/this=]'s [=cursor/value=] to undefined.
4592
+
4593
+
</div>
4594
+
4595
+
<aside class=note>
4596
+
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.
4597
+
</aside>
4598
+
4599
+
<aside class=advisement>
4600
+
🚧
4601
+
The {{IDBCursor/close()}} method is new in this edition.
1. If [=/this=]'s [=cursor/source=] or [=effective object
4665
4706
store=] has been deleted, [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4666
4707
4667
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4668
-
the cursor is being iterated or has iterated past its end,
4669
-
[=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4708
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4709
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4710
+
then [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
4670
4711
4671
4712
1. If [=/this=]'s [=cursor/key only flag=] is true, [=throw=] an
4672
4713
"{{InvalidStateError}}" {{DOMException}}.
@@ -6759,6 +6800,7 @@ For the revision history of the second edition, see [that document's Revision Hi
6759
6800
* Transactions are now temporarily made inactive during clone operations.
6760
6801
* Added {{IDBTransactionOptions/durability}} option and {{IDBTransaction/durability}} attribute. ([Issue #50](https://github.com/w3c/IndexedDB/issues/50))
6761
6802
* 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))
6803
+
* Added {{IDBCursor/close()}} method for {{IDBCursor}}. ([Issue #185](https://github.com/w3c/IndexedDB/issues/185))
0 commit comments