Open inexorabletash opened 4 years ago
Chrome doesn't implement it this way - properties are not visible on the IDBCursor until the event fires. They're applied synchronously just before the event is dispatched.
This is also how Firefox works. (And it's hard to imagine an implementation that operates using tasks not working this way.)
One possible approach:
IDBCursor
to have internal slots [[key]], [[primaryKey]], [[value]]key
, primaryKey
, and value
accessors to return the internal slot values(The wording here suffers a bit due to the lack of distinction between the concept-cursor and IDBCursor.)
When a cursor advances, say via
continue()
the steps use the iterate a cursor operation and the asynchronously execute a request steps. This means:That means the cursor properties update before the event fires, which means polling could see the properties change earlier. I think this is what the obscurely worded #339 is hinting at.
Chrome doesn't implement it this way - properties are not visible on the IDBCursor until the event fires. They're applied synchronously just before the event is dispatched.