Skip to content

Commit 9f15d18

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 e161310 commit 9f15d18

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
@@ -10386,17 +10386,11 @@ interface <dfn interface>DOMStringList</dfn> {
1038610386
<span>IsDataDescriptor</span>(<var>valueMessageDesc</var>) is false, and
1038710387
? <span>ToString</span>(<var>valueMessageDesc</var>.[[Value]]) otherwise.</p></li>
1038810388

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

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

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

1085010844
<li><p>Set <var>value</var> to <span>OrdinaryObjectCreate</span>(<var>prototype</var>, «
10851-
[[ErrorData]] »).</p></li>
10845+
[[ErrorData]], [[Stack]] »).</p></li>
1085210846

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

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

@@ -156433,8 +156427,11 @@ INSERT INTERFACES HERE
156433156427
<dt id="refsJPEG">[JPEG]</dt>
156434156428
<dd><cite><a href="https://www.w3.org/Graphics/JPEG/jfif3.pdf">JPEG File Interchange Format</a></cite>, E. Hamilton.</dd>
156435156429

156430+
<dt id="refsJSERRORSTACKACCESSOR">[JSERRORSTACKACCESSOR]</dt>
156431+
<dd><cite><a href="https://tc39.es/proposal-error-stack-accessor/">Error Stack Accessor</a></cite>. Ecma International.</dd>
156432+
156436156433
<dt id="refsJSERRORSTACKS">[JSERRORSTACKS]</dt>
156437-
<dd>(Non-normative) <cite><a href="https://tc39.es/proposal-error-stacks/">Error Stacks</a></cite>. Ecma International.</dd>
156434+
<dd><cite><a href="https://tc39.es/proposal-error-stacks/">Error Stacks</a></cite>. Ecma International.</dd>
156438156435

156439156436
<dt id="refsJSDYNAMICCODEBRANDCHECKS">[JSDYNAMICCODEBRANDCHECKS]</dt>
156440156437
<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)