Skip to content

Commit faa91a7

Browse files
authored
Merge pull request #590 from w3c/data-clone-error
When serializing some WebCodecs objects with `forStorage=true`, throw `DataCloneError` instead of `TypeError`
2 parents 1ceb71c + bc750fd commit faa91a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.src.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,7 +2528,7 @@
25282528
### Serialization ###{#encodedaudiochunk-serialization}
25292529
: The {{EncodedAudioChunk}} [=serialization steps=] (with |value|, |serialized|,
25302530
and |forStorage|) are:
2531-
:: 1. If |forStorage| is `true`, throw a {{TypeError}}.
2531+
:: 1. If |forStorage| is `true`, throw a {{DataCloneError}}.
25322532
2. For each {{EncodedAudioChunk}} internal slot in |value|, assign the value
25332533
of each internal slot to a field in |serialized| with the same name as
25342534
the internal slot.
@@ -2620,7 +2620,7 @@
26202620
### Serialization ###{#encodedvideochunk-serialization}
26212621
: The {{EncodedVideoChunk}} [=serialization steps=] (with |value|, |serialized|,
26222622
and |forStorage|) are:
2623-
:: 1. If |forStorage| is `true`, throw a {{TypeError}}.
2623+
:: 1. If |forStorage| is `true`, throw a {{DataCloneError}}.
26242624
2. For each {{EncodedVideoChunk}} internal slot in |value|, assign the value
26252625
of each internal slot to a field in |serialized| with the same name as
26262626
the internal slot.
@@ -2986,7 +2986,7 @@
29862986
|forStorage|) are:
29872987
:: 1. If |value|'s {{platform object/[[Detached]]}} is `true`, throw a
29882988
{{DataCloneError}} {{DOMException}}.
2989-
2. If |forStorage| is `true`, throw a {{TypeError}}.
2989+
2. If |forStorage| is `true`, throw a {{DataCloneError}}.
29902990
3. Let |resource| be the [=media resource=] referenced by
29912991
|value|'s {{AudioData/[[resource reference]]}}.
29922992
4. Let |newReference| be a new reference to |resource|.
@@ -4113,7 +4113,7 @@
41134113
|forStorage|) are:
41144114
:: 1. If |value|'s {{platform object/[[Detached]]}} is `true`, throw a
41154115
{{DataCloneError}} {{DOMException}}.
4116-
2. If |forStorage| is `true`, throw a {{TypeError}}.
4116+
2. If |forStorage| is `true`, throw a {{DataCloneError}}.
41174117
3. Let |resource| be the [=media resource=] referenced by
41184118
|value|'s {{VideoFrame/[[resource reference]]}}.
41194119
4. Let |newReference| be a new reference to |resource|.

0 commit comments

Comments
 (0)