Closed Bug 1508981 Opened 6 years ago Closed 4 years ago

Add/Put should throw TypeError if the arrayBuffer is detached

Categories

(Core :: Storage: IndexedDB, enhancement, P2)

enhancement

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox65 --- affected

People

(Reporter: baku, Assigned: baku)

Details

Attachments

(1 file, 1 obsolete file)

http://w3c.github.io/IndexedDB/#convert-a-value-to-a-key
"If input is a buffer source type - Let octets be the result of running the steps to get a copy of the bytes held by the buffer source input. Rethrow any exceptions."

https://heycam.github.io/webidl/#es-buffer-source-types
"If IsDetachedBuffer(O), then throw a TypeError."
Attached patch detached.patch (obsolete) — Splinter Review
Would be nice to use ErrorResult::ThrowTypeError<...> but that would require a refactoring of the error reporting in Key.cpp
Attachment #9026664 - Flags: review?(bugmail)
Attached patch detached.patchSplinter Review
Attachment #9026664 - Attachment is obsolete: true
Attachment #9026664 - Flags: review?(bugmail)
Attachment #9026668 - Flags: review?(bugmail)
Priority: -- → P2
Comment on attachment 9026668 [details] [diff] [review]
detached.patch

I'm going to transfer this review to Jan since he's touching other things in this area.  The review may be delayed a bit because of that.
Attachment #9026668 - Flags: review?(bugmail) → review?(jvarga)

This can be a good bug for you. Please refresh the patch and I'll review it.

Flags: needinfo?(ssengupta)
Flags: needinfo?(sgiesecke)
Attachment #9026668 - Flags: review?(jvarga)

When I read the spec from here: https://heycam.github.io/webidl/#es-buffer-source-types, it says something different now

If IsDetachedBuffer(arrayBuffer) is true, then return the empty byte sequence.

Perhaps the course of action would be to first revise the tests if necessary, and if the tests then fail, then file a different bug?

Flags: needinfo?(ssengupta) → needinfo?(jvarga)

Indeed, the wording of this was changed in January by :annevk via https://github.com/heycam/webidl/pull/605

Flags: needinfo?(sgiesecke)

Yeah, maybe file a new bug.

Flags: needinfo?(jvarga)

:ssengupta, you take action here?

Flags: needinfo?(ssengupta)

I find no discrepancy between spec. and current code here. :baku, would you close this bug then?

Flags: needinfo?(ssengupta) → needinfo?(amarchesini)

Spec has changed.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(amarchesini)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: