From aeee8796d8cb3edbd943e953df2df04092a146fb Mon Sep 17 00:00:00 2001
From: Domenic Denicola Let prototype be "Error". Let name be ? Get(value,
+ "name"). Let valueProto be ! value.[[GetPrototypeOf]](). If valueProto is %EvalErrorPrototype%, then set
- prototype to "EvalError". If valueProto is %RangeErrorPrototype%, then set
- prototype to "RangeError". If valueProto is %ReferenceErrorPrototype%, then set
- prototype to "ReferenceError". If valueProto is %SyntaxErrorPrototype%, then set
- prototype to "SyntaxError". If valueProto is %TypeErrorPrototype%, then set
- prototype to "TypeError". If valueProto is %URIErrorPrototype%, then set
- prototype to "URIError". If name is not one of "Error", "EvalError", "RangeError", "ReferenceError",
+ "SyntaxError", "TypeError", or "URIError", then set name to "Error". Let valueMessageDesc be ? value.[[GetOwnProperty]]("
-
message
").
Set serialized to { [[Type]]: "Error", [[Prototype]]: prototype, +
Set serialized to { [[Type]]: "Error", [[Name]]: name, [[Message]]: message }.
Let prototype be %ErrorPrototype%.
If serialized.[[Prototype]] is "EvalError", then set prototype to +
If serialized.[[Name]] is "EvalError", then set prototype to %EvalErrorPrototype%.
If serialized.[[Prototype]] is "RangeError", then set prototype +
If serialized.[[Name]] is "RangeError", then set prototype to %RangeErrorPrototype%.
If serialized.[[Prototype]] is "ReferenceError", then set +
If serialized.[[Name]] is "ReferenceError", then set prototype to %ReferenceErrorPrototype%.
If serialized.[[Prototype]] is "SyntaxError", then set prototype +
If serialized.[[Name]] is "SyntaxError", then set prototype to %SyntaxErrorPrototype%.
If serialized.[[Prototype]] is "TypeError", then set prototype to +
If serialized.[[Name]] is "TypeError", then set prototype to %TypeErrorPrototype%.
If serialized.[[Prototype]] is "URIError", then set prototype to +
If serialized.[[Name]] is "URIError", then set prototype to %URIErrorPrototype%.
Let message be serialized.[[Message]].