Closed Bug 1200496 Opened 9 years ago Closed 5 years ago

make DOMError instance could be handled by the structured clone algorithm

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
firefox43 --- affected

People

(Reporter: steveck, Unassigned)

Details

(Keywords: dev-doc-needed)

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?
(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?
(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."
Component: DOM → DOM: Core & HTML

If this is standardized we can reconsider.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.