Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consult .name instead of [[Prototype]] for Error serialization #5150

Merged
merged 2 commits into from
Jan 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 11 additions & 27 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -8397,27 +8397,11 @@ interface <dfn>DOMStringList</dfn> {
too -->

<ol>
<li><p>Let <var>prototype</var> be "Error".</p></li>
<li><p>Let <var>name</var> be ? <span data-x="js-Get">Get</span>(<var>value</var>,
"name").</p></li>

<li><p>Let <var>valueProto</var> be ! <var>value</var>.[[GetPrototypeOf]]().</p></li>

<li><p>If <var>valueProto</var> is <span>%EvalErrorPrototype%</span>, then set
<var>prototype</var> to "EvalError".</p></li>

<li><p>If <var>valueProto</var> is <span>%RangeErrorPrototype%</span>, then set
<var>prototype</var> to "RangeError".</p></li>

<li><p>If <var>valueProto</var> is <span>%ReferenceErrorPrototype%</span>, then set
<var>prototype</var> to "ReferenceError".</p></li>

<li><p>If <var>valueProto</var> is <span>%SyntaxErrorPrototype%</span>, then set
<var>prototype</var> to "SyntaxError".</p></li>

<li><p>If <var>valueProto</var> is <span>%TypeErrorPrototype%</span>, then set
<var>prototype</var> to "TypeError".</p></li>

<li><p>If <var>valueProto</var> is <span>%URIErrorPrototype%</span>, then set
<var>prototype</var> to "URIError".</p></li>
<li><p>If <var>name</var> is not one of "Error", "EvalError", "RangeError", "ReferenceError",
"SyntaxError", "TypeError", or "URIError", then set <var>name</var> to "Error".</p></li>
domenic marked this conversation as resolved.
Show resolved Hide resolved

<li><p>Let <var>valueMessageDesc</var> be ? <var>value</var>.[[GetOwnProperty]]("<code
data-x="">message</code>").</p></li>
Expand All @@ -8426,7 +8410,7 @@ interface <dfn>DOMStringList</dfn> {
<span>IsDataDescriptor</span>(<var>valueMessageDesc</var>) is false, and
? <span>ToString</span>(<var>valueMessageDesc</var>.[[Value]]) otherwise.</p></li>

<li><p>Set <var>serialized</var> to { [[Type]]: "Error", [[Prototype]]: <var>prototype</var>,
<li><p>Set <var>serialized</var> to { [[Type]]: "Error", [[Name]]: <var>name</var>,
[[Message]]: <var>message</var> }.</p></li>

<li>
Expand Down Expand Up @@ -8855,22 +8839,22 @@ o.myself = o;</code></pre>
<ol>
<li><p>Let <var>prototype</var> be <span>%ErrorPrototype%</span>.</p></li>

<li><p>If <var>serialized</var>.[[Prototype]] is "EvalError", then set <var>prototype</var> to
<li><p>If <var>serialized</var>.[[Name]] is "EvalError", then set <var>prototype</var> to
<span>%EvalErrorPrototype%</span>.</p></li>

<li><p>If <var>serialized</var>.[[Prototype]] is "RangeError", then set <var>prototype</var>
<li><p>If <var>serialized</var>.[[Name]] is "RangeError", then set <var>prototype</var>
to <span>%RangeErrorPrototype%</span>.</p></li>

<li><p>If <var>serialized</var>.[[Prototype]] is "ReferenceError", then set
<li><p>If <var>serialized</var>.[[Name]] is "ReferenceError", then set
<var>prototype</var> to <span>%ReferenceErrorPrototype%</span>.</p></li>

<li><p>If <var>serialized</var>.[[Prototype]] is "SyntaxError", then set <var>prototype</var>
<li><p>If <var>serialized</var>.[[Name]] is "SyntaxError", then set <var>prototype</var>
to <span>%SyntaxErrorPrototype%</span>.</p></li>

<li><p>If <var>serialized</var>.[[Prototype]] is "TypeError", then set <var>prototype</var> to
<li><p>If <var>serialized</var>.[[Name]] is "TypeError", then set <var>prototype</var> to
<span>%TypeErrorPrototype%</span>.</p></li>

<li><p>If <var>serialized</var>.[[Prototype]] is "URIError", then set <var>prototype</var> to
<li><p>If <var>serialized</var>.[[Name]] is "URIError", then set <var>prototype</var> to
<span>%URIErrorPrototype%</span>.</p></li>

<li><p>Let <var>message</var> be <var>serialized</var>.[[Message]].</p></li>
Expand Down