Closed
Bug 1392070
Opened 7 years ago
Closed 7 years ago
Stop using StopIteration in Sqlite.jsm
Categories
(Core :: SQLite and Embedded Database Bindings, enhancement)
Core
SQLite and Embedded Database Bindings
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: emk, Assigned: emk)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Sqlite.jsm is abusing StopIteration to indicate user cancelling in onRow callback.
It does not even follow the legacy iteration protocol.
We should use something different to drop StopIteration. Fortunately, we don't have to concern addon-compat anymore.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•7 years ago
|
||
This patch is using a string instead of the global singleton. I'd appreciate better suggestions.
Comment 3•7 years ago
|
||
Maybe we could change the onRow signature from onRow(row) to onRow(row, canceler), so that the onRow consumer can invoke canceler(). Internally it can just do the same as the current StopIteration exception.
Comment 4•7 years ago
|
||
Comment on attachment 8899246 [details]
Bug 1392070 - Stop using the StopIteration object in Sqlite.jsm.
Removing the review flag as Marco offered a suggestion.
Attachment #8899246 -
Flags: review?(florian)
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8899246 [details]
Bug 1392070 - Stop using the StopIteration object in Sqlite.jsm.
https://reviewboard.mozilla.org/r/170498/#review176234
::: toolkit/modules/Sqlite.jsm:1286
(Diff revision 2)
> * resources.
> *
> * If a `StopIteration` is thrown during execution of an `onRow` handler,
> * the execution of the statement is immediately cancelled. Subsequent
> * rows will not be processed and no more `onRow` invocations will be made.
> * The promise is resolved immediately.
This comment must be updated
::: toolkit/modules/Sqlite.jsm:1290
(Diff revision 2)
> * rows will not be processed and no more `onRow` invocations will be made.
> * The promise is resolved immediately.
> *
> * If a non-`StopIteration` exception is thrown by the `onRow` handler, the
> * exception is logged and processing of subsequent rows occurs as if nothing
> * happened. The promise is still resolved (not rejected).
as well as this one
Attachment #8899246 -
Flags: review?(mak77) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Comment 8•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8899246 [details]
Bug 1392070 - Stop using the StopIteration object in Sqlite.jsm.
https://reviewboard.mozilla.org/r/170498/#review176234
> This comment must be updated
Comments updated.
Pushed by VYV03354@nifty.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/b9ae810f6a04
Stop using the StopIteration object in Sqlite.jsm. r=mak
Comment 10•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Updated•3 months ago
|
Product: Toolkit → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•