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
4442
4450
"{{InvalidStateError}}" {{DOMException}}.
4443
4451
4444
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4445
-
the cursor is being iterated or has iterated past its end,
4446
-
[=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4452
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4453
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4454
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4447
4455
4448
4456
1. If |key| is given, then:
4449
4457
@@ -4503,9 +4511,9 @@ The <dfn method for=IDBCursor>continuePrimaryKey(|key|, |primaryKey|)</dfn> meth
4503
4511
1. If [=/this=]'s [=cursor/direction=] is not "{{IDBCursorDirection/next}}" or "{{IDBCursorDirection/prev}}",
4504
4512
[=exception/throw=] an "{{InvalidAccessError}}" {{DOMException}}.
4505
4513
4506
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4507
-
the cursor is being iterated or has iterated past its end,
4508
-
[=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4514
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4515
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4516
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4509
4517
4510
4518
1. Let |r| be the result of [=/converting a value to
4511
4519
a key=] with |key|. Rethrow any exceptions.
@@ -4562,6 +4570,39 @@ The <dfn method for=IDBCursor>continuePrimaryKey(|key|, |primaryKey|)</dfn> meth
4562
4570
flag=] has been set to false.
4563
4571
</aside>
4564
4572
4573
+
<div algorithm>
4574
+
4575
+
The <dfn method for=IDBCursor>close()</dfn> method steps are:
4576
+
4577
+
1. Let |transaction| be [=/this=]'s [=cursor/transaction=].
4578
+
4579
+
1. If |transaction|'s [=transaction/state=] is not [=transaction/active=], then [=exception/throw=] a "{{TransactionInactiveError}}" {{DOMException}}.
4580
+
4581
+
1. If [=/this=]'s [=cursor/source=] or [=cursor/effective object store=] has been deleted, then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4582
+
4583
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4584
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4585
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4586
+
4587
+
1. Set [=/this=]'s [=cursor/got value flag=] to false.
4588
+
4589
+
1. Set [=/this=]'s [=cursor/key=] to undefined.
4590
+
4591
+
1. If [=/this=]'s [=cursor/source=] is an [=/index=], then set [=/this=]'s [=cursor/object store position=] to undefined.
4592
+
4593
+
1. If [=/this=]'s [=cursor/key only flag=] is false, then set [=/this=]'s [=cursor/value=] to undefined.
4594
+
4595
+
</div>
4596
+
4597
+
<aside class=note>
4598
+
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.
4599
+
</aside>
4600
+
4601
+
<aside class=advisement>
4602
+
🚧
4603
+
The {{IDBCursor/close()}} method is new in this edition.
1. If [=/this=]'s [=cursor/source=] or [=cursor/effective object
4667
4708
store=] has been deleted, [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4668
4709
4669
-
1. If [=/this=]'s [=cursor/got value flag=] is false, indicating that
4670
-
the cursor is being iterated or has iterated past its end,
4671
-
[=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4710
+
1. If [=/this=]'s [=cursor/got value flag=] is false
4711
+
(indicating that the cursor is being iterated, has iterated past its end, or that {{IDBCursor/close()}} was called),
4712
+
then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
4672
4713
4673
4714
1. If [=/this=]'s [=cursor/key only flag=] is true, [=exception/throw=] an
4674
4715
"{{InvalidStateError}}" {{DOMException}}.
@@ -6781,6 +6822,7 @@ For the revision history of the second edition, see [that document's Revision Hi
6781
6822
* 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