HTML integration for "Error Stack Accessor" TC39 Proposal#12239
HTML integration for "Error Stack Accessor" TC39 Proposal#12239ljharb wants to merge 1 commit intowhatwg:mainfrom
Conversation
Replace the non-normative "should" language about serializing "interesting accompanying data" with normative steps that explicitly serialize and deserialize the stack trace of Error objects during structured cloning. In StructuredSerializeInternal, the stack trace is obtained as an implementation-defined string and included in the serialized record as [[Stack]]. In StructuredDeserialize, the Error object is created with a [[Stack]] internal slot, which is set to an implementation-defined value representing the stack trace from the serialized record. This ensures the Error.prototype.stack accessor continues to work properly on deserialized errors. The bibliography is updated to reference both the Error Stack Accessor and Error Stacks proposals. This is the HTML integration PR for tc39/proposal-error-stack-accessor. See tc39/proposal-error-stack-accessor#9 and tc39/proposal-error-stack-accessor#8
nicolo-ribaudo
left a comment
There was a problem hiding this comment.
There is other "interesting data" that should still be copied over, such as https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/lineNumber.
|
@nicolo-ribaudo should that be called out, or left implementation-defined? |
a426672 to
9f15d18
Compare
|
The old spec text was:
You replaced it with explicit steps to copy
|
annevk
left a comment
There was a problem hiding this comment.
And yeah, let's preserve the "interesting accompanying data" step as well. Hopefully one day that won't be needed anymore.
9f12aa1 to
72af89f
Compare
72af89f to
ed48b89
Compare
Replace the non-normative "should" language about serializing "interesting accompanying data" with normative steps that explicitly serialize and deserialize the stack trace of Error objects during structured cloning.
In StructuredSerializeInternal, the stack trace is obtained as an implementation-defined string and included in the serialized record as [[Stack]].
In StructuredDeserialize, the Error object is created with a [[Stack]] internal slot, which is set to an implementation-defined value representing the stack trace from the serialized record. This ensures the Error.prototype.stack accessor continues to work properly on deserialized errors.
The bibliography is updated to reference both the Error Stack Accessor and Error Stacks proposals.
This is the HTML integration PR for tc39/proposal-error-stack-accessor.
See tc39/proposal-error-stack-accessor#9 and tc39/proposal-error-stack-accessor#8, as well as whatwg/webidl#1578
(See WHATWG Working Mode: Changes for more details.)
/references.html ( diff )
/structured-data.html ( diff )