Skip to content

Commit a426672

Browse files
committed
HTML integration for "Error Stack Accessor" TC39 Proposal
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
1 parent 83f1b8d commit a426672

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

source

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10385,17 +10385,11 @@ interface <dfn interface>DOMStringList</dfn> {
1038510385
<span>IsDataDescriptor</span>(<var>valueMessageDesc</var>) is false, and
1038610386
? <span>ToString</span>(<var>valueMessageDesc</var>.[[Value]]) otherwise.</p></li>
1038710387

10388-
<li><p>Set <var>serialized</var> to { [[Type]]: "Error", [[Name]]: <var>name</var>,
10389-
[[Message]]: <var>message</var> }.</p></li>
10390-
10391-
<li>
10392-
<p>User agents should attach a serialized representation of any interesting accompanying
10393-
data which are not yet specified, notably the <code data-x="">stack</code> property, to
10394-
<var>serialized</var>.</p>
10388+
<li><p>Let <var>stack</var> be an implementation-defined string that represents the stack
10389+
trace of <var>value</var>. <ref>JSERRORSTACKACCESSOR</ref> <ref>JSERRORSTACKS</ref></p></li>
1039510390

10396-
<p class="note">See the <cite>Error Stacks</cite> proposal for in-progress work on specifying
10397-
this data. <ref>JSERRORSTACKS</ref></p>
10398-
</li>
10391+
<li><p>Set <var>serialized</var> to { [[Type]]: "Error", [[Name]]: <var>name</var>,
10392+
[[Message]]: <var>message</var>, [[Stack]]: <var>stack</var> }.</p></li>
1039910393
</ol>
1040010394
</li>
1040110395

@@ -10847,7 +10841,7 @@ o.myself = o;</code></pre>
1084710841
<li><p>Let <var>message</var> be <var>serialized</var>.[[Message]].</p></li>
1084810842

1084910843
<li><p>Set <var>value</var> to <span>OrdinaryObjectCreate</span>(<var>prototype</var>, «
10850-
[[ErrorData]] »).</p></li>
10844+
[[ErrorData]], [[Stack]] »).</p></li>
1085110845

1085210846
<li><p>Let <var>messageDesc</var> be <span>PropertyDescriptor</span> { [[Value]]:
1085310847
<var>message</var>, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true
@@ -10857,8 +10851,8 @@ o.myself = o;</code></pre>
1085710851
<span>OrdinaryDefineOwnProperty</span>(<var>value</var>, "<code data-x="">message</code>",
1085810852
<var>messageDesc</var>).</p></li>
1085910853

10860-
<li><p>Any interesting accompanying data attached to <var>serialized</var> should be
10861-
deserialized and attached to <var>value</var>.</p></li>
10854+
<li><p>Set <var>value</var>.[[Stack]] to an implementation-defined value that represents
10855+
the stack trace serialized in <var>serialized</var>.[[Stack]].</p></li>
1086210856
</ol>
1086310857
</li>
1086410858

@@ -156207,8 +156201,11 @@ INSERT INTERFACES HERE
156207156201
<dt id="refsJPEG">[JPEG]</dt>
156208156202
<dd><cite><a href="https://www.w3.org/Graphics/JPEG/jfif3.pdf">JPEG File Interchange Format</a></cite>, E. Hamilton.</dd>
156209156203

156204+
<dt id="refsJSERRORSTACKACCESSOR">[JSERRORSTACKACCESSOR]</dt>
156205+
<dd><cite><a href="https://tc39.es/proposal-error-stack-accessor/">Error Stack Accessor</a></cite>. Ecma International.</dd>
156206+
156210156207
<dt id="refsJSERRORSTACKS">[JSERRORSTACKS]</dt>
156211-
<dd>(Non-normative) <cite><a href="https://tc39.es/proposal-error-stacks/">Error Stacks</a></cite>. Ecma International.</dd>
156208+
<dd><cite><a href="https://tc39.es/proposal-error-stacks/">Error Stacks</a></cite>. Ecma International.</dd>
156212156209

156213156210
<dt id="refsJSDYNAMICCODEBRANDCHECKS">[JSDYNAMICCODEBRANDCHECKS]</dt>
156214156211
<dd><cite><a href="https://tc39.es/proposal-dynamic-code-brand-checks/">Dynamic code brand checks</a></cite>. Ecma International.</dd>

0 commit comments

Comments
 (0)