Repository navigation
HTML integration for "Error Stack Accessor" TC39 Proposal - #12239
Conversation
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
- Access value.[[Stack]] in serialization (annevk) - Reorder: Set serialized before User agents should... step - Drop "notably the stack property" example from interesting accompanying data step (now explicit) (annevk) - Simplify deserialize: pass serialized.[[Stack]] through as-is rather than re-wrapping as implementation-defined (annevk)
ed48b89 to
0b68000
Compare
annevk
left a comment
There was a problem hiding this comment.
This looks good now. I guess now we have to wait for these proposals to reach stage 2.7-3.
|
The proposal is now stage 3, and test262 tests for it have been merged. |
…ion (#58397) Add tests for DOMException .stack behavior per the TC39 Error Stack Accessor proposal (https://tc39.es/proposal-error-stack-accessor/) and HTML (whatwg/html#12239) & Web IDL (whatwg/webidl#1421) integration: - DOMException instances get .stack as a string via Error.prototype.stack accessor - Error.prototype.stack property descriptor has correct accessor attributes - Error.prototype.stack getter works on DOMException instances - Error.prototype.stack setter (SetterThatIgnoresPrototypeProperties) behavior - DOMException.prototype does not have an own stack property Add tests for structured clone serialization/deserialization of [[Stack]]: - structuredClone() preserves .stack on Error and all NativeError subtypes - structuredClone() preserves .stack on DOMException (constructed and thrown) - Cloned .stack is accessed via the accessor, not as an own property See also tc39/proposal-error-stack-accessor#9 and tc39/proposal-error-stack-accessor#8.
Since DOMException objects have [[ErrorData]], the Error.prototype.stack accessor from the Error Stack Accessor proposal applies to them. Tests: web-platform-tests/wpt#58397. Corresponding HTML PR: whatwg/html#12239. See also tc39/proposal-error-stack-accessor#9 and tc39/proposal-error-stack-accessor#8.
…roposal web platform integration, a=testonly Automatic update from web-platform-tests Add WPT tests for Error Stack Accessor proposal web platform integration (#58397) Add tests for DOMException .stack behavior per the TC39 Error Stack Accessor proposal (https://tc39.es/proposal-error-stack-accessor/) and HTML (whatwg/html#12239) & Web IDL (whatwg/webidl#1421) integration: - DOMException instances get .stack as a string via Error.prototype.stack accessor - Error.prototype.stack property descriptor has correct accessor attributes - Error.prototype.stack getter works on DOMException instances - Error.prototype.stack setter (SetterThatIgnoresPrototypeProperties) behavior - DOMException.prototype does not have an own stack property Add tests for structured clone serialization/deserialization of [[Stack]]: - structuredClone() preserves .stack on Error and all NativeError subtypes - structuredClone() preserves .stack on DOMException (constructed and thrown) - Cloned .stack is accessed via the accessor, not as an own property See also tc39/proposal-error-stack-accessor#9 and tc39/proposal-error-stack-accessor#8. -- wpt-commits: a6fd2ac12d6662adafc266a4431c8cbdf1eb0195 wpt-pr: 58397
…roposal web platform integration, a=testonly Automatic update from web-platform-tests Add WPT tests for Error Stack Accessor proposal web platform integration (#58397) Add tests for DOMException .stack behavior per the TC39 Error Stack Accessor proposal (https://tc39.es/proposal-error-stack-accessor/) and HTML (whatwg/html#12239) & Web IDL (whatwg/webidl#1421) integration: - DOMException instances get .stack as a string via Error.prototype.stack accessor - Error.prototype.stack property descriptor has correct accessor attributes - Error.prototype.stack getter works on DOMException instances - Error.prototype.stack setter (SetterThatIgnoresPrototypeProperties) behavior - DOMException.prototype does not have an own stack property Add tests for structured clone serialization/deserialization of [[Stack]]: - structuredClone() preserves .stack on Error and all NativeError subtypes - structuredClone() preserves .stack on DOMException (constructed and thrown) - Cloned .stack is accessed via the accessor, not as an own property See also tc39/proposal-error-stack-accessor#9 and tc39/proposal-error-stack-accessor#8. -- wpt-commits: a6fd2ac12d6662adafc266a4431c8cbdf1eb0195 wpt-pr: 58397 UltraBlame original commit: 7c5705517993438019c649bc426e1cb442656635
…roposal web platform integration, a=testonly Automatic update from web-platform-tests Add WPT tests for Error Stack Accessor proposal web platform integration (#58397) Add tests for DOMException .stack behavior per the TC39 Error Stack Accessor proposal (https://tc39.es/proposal-error-stack-accessor/) and HTML (whatwg/html#12239) & Web IDL (whatwg/webidl#1421) integration: - DOMException instances get .stack as a string via Error.prototype.stack accessor - Error.prototype.stack property descriptor has correct accessor attributes - Error.prototype.stack getter works on DOMException instances - Error.prototype.stack setter (SetterThatIgnoresPrototypeProperties) behavior - DOMException.prototype does not have an own stack property Add tests for structured clone serialization/deserialization of [[Stack]]: - structuredClone() preserves .stack on Error and all NativeError subtypes - structuredClone() preserves .stack on DOMException (constructed and thrown) - Cloned .stack is accessed via the accessor, not as an own property See also tc39/proposal-error-stack-accessor#9 and tc39/proposal-error-stack-accessor#8. -- wpt-commits: a6fd2ac12d6662adafc266a4431c8cbdf1eb0195 wpt-pr: 58397 UltraBlame original commit: 7c5705517993438019c649bc426e1cb442656635
…roposal web platform integration, a=testonly Automatic update from web-platform-tests Add WPT tests for Error Stack Accessor proposal web platform integration (#58397) Add tests for DOMException .stack behavior per the TC39 Error Stack Accessor proposal (https://tc39.es/proposal-error-stack-accessor/) and HTML (whatwg/html#12239) & Web IDL (whatwg/webidl#1421) integration: - DOMException instances get .stack as a string via Error.prototype.stack accessor - Error.prototype.stack property descriptor has correct accessor attributes - Error.prototype.stack getter works on DOMException instances - Error.prototype.stack setter (SetterThatIgnoresPrototypeProperties) behavior - DOMException.prototype does not have an own stack property Add tests for structured clone serialization/deserialization of [[Stack]]: - structuredClone() preserves .stack on Error and all NativeError subtypes - structuredClone() preserves .stack on DOMException (constructed and thrown) - Cloned .stack is accessed via the accessor, not as an own property See also tc39/proposal-error-stack-accessor#9 and tc39/proposal-error-stack-accessor#8. -- wpt-commits: a6fd2ac12d6662adafc266a4431c8cbdf1eb0195 wpt-pr: 58397 UltraBlame original commit: 7c5705517993438019c649bc426e1cb442656635
…roposal web platform integration, a=testonly Automatic update from web-platform-tests Add WPT tests for Error Stack Accessor proposal web platform integration (#58397) Add tests for DOMException .stack behavior per the TC39 Error Stack Accessor proposal (https://tc39.es/proposal-error-stack-accessor/) and HTML (whatwg/html#12239) & Web IDL (whatwg/webidl#1421) integration: - DOMException instances get .stack as a string via Error.prototype.stack accessor - Error.prototype.stack property descriptor has correct accessor attributes - Error.prototype.stack getter works on DOMException instances - Error.prototype.stack setter (SetterThatIgnoresPrototypeProperties) behavior - DOMException.prototype does not have an own stack property Add tests for structured clone serialization/deserialization of [[Stack]]: - structuredClone() preserves .stack on Error and all NativeError subtypes - structuredClone() preserves .stack on DOMException (constructed and thrown) - Cloned .stack is accessed via the accessor, not as an own property See also tc39/proposal-error-stack-accessor#9 and tc39/proposal-error-stack-accessor#8. -- wpt-commits: a6fd2ac12d6662adafc266a4431c8cbdf1eb0195 wpt-pr: 58397
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 )