Closed Bug 825195 Opened 7 years ago Closed 7 years ago

Update method signatures of TextDecoder and TextEncoder per the latest spec

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: emk, Assigned: emk)

References

()

Details

Attachments

(1 file)

No description provided.
Attached patch patchSplinter Review
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Attachment #696300 - Flags: review?(jonas)
Comment on attachment 696300 [details] [diff] [review]
patch

Review of attachment 696300 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/encoding/TextDecoder.h
@@ +58,5 @@
>  
> +  void Decode(nsAString& aOutDecodedString,
> +              ErrorResult& aRv) {
> +    TextDecoderBase::Decode(EmptyCString().BeginReading(),
> +                            EmptyCString().Length(), false,

You should be able to just pass nullptr and 0 here. The callee should never dereference any of the data anyway since any dereferences would be past the end of the data.

::: dom/workers/TextDecoder.h
@@ +40,5 @@
>    void
> +  Decode(nsAString& aOutDecodedString,
> +         ErrorResult& aRv) {
> +    TextDecoderBase::Decode(EmptyCString().BeginReading(),
> +                            EmptyCString().Length(), false,

Same here
Attachment #696300 - Flags: review?(jonas) → review+
(In reply to Jonas Sicking (:sicking) from comment #3)
> You should be able to just pass nullptr and 0 here. The callee should never
> dereference any of the data anyway since any dereferences would be past the
> end of the data.

Sure. Landed with the fix.
https://hg.mozilla.org/integration/mozilla-inbound/rev/abfe3957551b
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/abfe3957551b
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.