1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /* ES6 20140718 draft 19.5.3.4. */
6 function ErrorToString() {
10 ThrowTypeError(JSMSG_INCOMPATIBLE_PROTO, "Error", "toString", "value");
15 name = name === undefined ? "Error" : ToString(name);
18 var msg = obj.message;
19 msg = msg === undefined ? "" : ToString(msg);
32 return name + ": " + msg;
35 function ErrorToStringWithTrailingNewline() {
36 return FUN_APPLY(ErrorToString, this, []) + "\n";