Skip to content

Commit ed48b89

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 5545634 commit ed48b89

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

source

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10423,17 +10423,17 @@ interface <dfn interface>DOMStringList</dfn> {
1042310423
<span>IsDataDescriptor</span>(<var>valueMessageDesc</var>) is false, and
1042410424
? <span>ToString</span>(<var>valueMessageDesc</var>.[[Value]]) otherwise.</p></li>
1042510425

10426-
<li><p>Set <var>serialized</var> to { [[Type]]: "Error", [[Name]]: <var>name</var>,
10427-
[[Message]]: <var>message</var> }.</p></li>
10426+
<li><p>Let <var>stack</var> be an <span>implementation-defined</span> string that
10427+
represents the stack trace of <var>value</var>. <ref>JSERRORSTACKACCESSOR</ref>
10428+
<ref>JSERRORSTACKS</ref></p></li>
1042810429

1042910430
<li>
1043010431
<p>User agents should attach a serialized representation of any interesting accompanying
1043110432
data which are not yet specified, notably the <code data-x="">stack</code> property, to
1043210433
<var>serialized</var>.</p>
1043310434

10434-
<p class="note">See the <cite>Error Stacks</cite> proposal for in-progress work on specifying
10435-
this data. <ref>JSERRORSTACKS</ref></p>
10436-
</li>
10435+
<li><p>Set <var>serialized</var> to { [[Type]]: "Error", [[Name]]: <var>name</var>,
10436+
[[Message]]: <var>message</var>, [[Stack]]: <var>stack</var> }.</p></li>
1043710437
</ol>
1043810438
</li>
1043910439

@@ -10885,7 +10885,7 @@ o.myself = o;</code></pre>
1088510885
<li><p>Let <var>message</var> be <var>serialized</var>.[[Message]].</p></li>
1088610886

1088710887
<li><p>Set <var>value</var> to <span>OrdinaryObjectCreate</span>(<var>prototype</var>, «
10888-
[[ErrorData]] »).</p></li>
10888+
[[ErrorData]], [[Stack]] »).</p></li>
1088910889

1089010890
<li><p>Let <var>messageDesc</var> be <span>PropertyDescriptor</span> { [[Value]]:
1089110891
<var>message</var>, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true
@@ -10895,6 +10895,9 @@ o.myself = o;</code></pre>
1089510895
<span>OrdinaryDefineOwnProperty</span>(<var>value</var>, "<code data-x="">message</code>",
1089610896
<var>messageDesc</var>).</p></li>
1089710897

10898+
<li><p>Set <var>value</var>.[[Stack]] to an implementation-defined string that represents
10899+
the stack trace serialized in <var>serialized</var>.[[Stack]].</p></li>
10900+
1089810901
<li><p>Any interesting accompanying data attached to <var>serialized</var> should be
1089910902
deserialized and attached to <var>value</var>.</p></li>
1090010903
</ol>
@@ -157004,8 +157007,11 @@ INSERT INTERFACES HERE
157004157007
<dt id="refsJPEG">[JPEG]</dt>
157005157008
<dd><cite><a href="https://www.w3.org/Graphics/JPEG/jfif3.pdf">JPEG File Interchange Format</a></cite>, E. Hamilton.</dd>
157006157009

157010+
<dt id="refsJSERRORSTACKACCESSOR">[JSERRORSTACKACCESSOR]</dt>
157011+
<dd><cite><a href="https://tc39.es/proposal-error-stack-accessor/">Error Stack Accessor</a></cite>. Ecma International.</dd>
157012+
157007157013
<dt id="refsJSERRORSTACKS">[JSERRORSTACKS]</dt>
157008-
<dd>(Non-normative) <cite><a href="https://tc39.es/proposal-error-stacks/">Error Stacks</a></cite>. Ecma International.</dd>
157014+
<dd><cite><a href="https://tc39.es/proposal-error-stacks/">Error Stacks</a></cite>. Ecma International.</dd>
157009157015

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