summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/error-toString.js
blob: 44839333d9b5a5d8dabae636f33318384d3aa179 (plain)
1
2
3
4
5
6
7
8
9
var errorToString = Error.prototype.toString;


assertEq(errorToString.call({message: "", name: ""}), "");
assertEq(errorToString.call({name: undefined, message: ""}), "Error");
assertEq(errorToString.call({name: "Test", message: undefined}), "Test");
assertEq(errorToString.call({name: "Test", message: ""}), "Test");
assertEq(errorToString.call({name: "", message: "Test"}), "Test");
assertEq(errorToString.call({name: "Test", message: "it!"}), "Test: it!");