If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

make DOMError instance could be handled by the structured clone algorithm

NEW
Unassigned

Status

()

Core
DOM
2 years ago
2 years ago

People

(Reporter: steveck, Unassigned)

Tracking

({dev-doc-needed})

Trunk
dev-doc-needed
Points:
---

Firefox Tracking Flags

(firefox43 affected)

Details

(Reporter)

Description

2 years ago
In the near future we might need to use WebAPI in the context different than window(currently will be in iframe, or in worker for long term plan) and communicate through worker/broadcast channel/... postMessage(). So it would be easier if the data returned from API could be handled by the structured clone algorithm naturally.
DOMError is deprecated. Why are you still using it?
(Reporter)

Comment 2

2 years ago
(In reply to :Ms2ger from comment #1)
> DOMError is deprecated. Why are you still using it?

1) MDN didn't say it's deprecated.
2) mozMobileMessage API still utilized it. Hi Bevis, do we have plan to replace DOMError?
Flags: needinfo?(btseng)
(In reply to Steve Chung [:steveck] from comment #2)
> (In reply to :Ms2ger from comment #1)
> > DOMError is deprecated. Why are you still using it?
> 
> 1) MDN didn't say it's deprecated.
> 2) mozMobileMessage API still utilized it. Hi Bevis, do we have plan to
> replace DOMError?

No, I was informed that we have to adopt Promise for all the newly defined APIs instead of replacing all the existing APIs with Promise.

I guess what :Ms2ger means here is that there is no further enhancement in DOMError since DOMError is deprecated and we might have to define a new set of APIs which allow us to support structure clone algorithm directly.
Flags: needinfo?(btseng)
Is it a big work to make DOMError cloneable ?
I don't think normal `Error` is cloneable either is it?
Keywords: dev-doc-needed

Comment 6

2 years ago
(In reply to Wilson Page [:wilsonpage] from comment #5)
> I don't think normal `Error` is cloneable either is it?
Right, 
per https://html.spec.whatwg.org/multipage/infrastructure.html#safe-passing-of-structured-data 
"If input is another native object type (e.g. Error, Function) ... Throw a DataCloneError exception and abort the overall structured clone algorithm."
You need to log in before you can comment on or make changes to this bug.