Index: test/mjsunit/error-tostring-omit.js |
diff --git a/test/mjsunit/regress/regress-237617.js b/test/mjsunit/error-tostring-omit.js |
similarity index 61% |
copy from test/mjsunit/regress/regress-237617.js |
copy to test/mjsunit/error-tostring-omit.js |
index 7b7e50f247c7e4b29d2a4ba7892c280336ae04e6..ce7b2dc88e2d6be44015b704c5b697bf0d0da9e3 100644 |
--- a/test/mjsunit/regress/regress-237617.js |
+++ b/test/mjsunit/error-tostring-omit.js |
@@ -25,18 +25,37 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-"use strict" |
+function veryLongString() { |
+ return "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + |
+ "Nam vulputate metus est. Maecenas quis pellentesque eros," + |
+ "ac mattis augue. Nam porta purus vitae tincidunt blandit." + |
+ "Aliquam lacus dui, blandit id consectetur id, hendrerit ut" + |
+ "felis. Class aptent taciti sociosqu ad litora torquent per" + |
+ "conubia nostra, per inceptos himenaeos. Ut posuere eros et" + |
+ "tempus luctus. Nullam condimentum aliquam odio, at dignissim" + |
+ "augue tincidunt in. Nam mattis vitae mauris eget dictum." + |
+ "Nam accumsan dignissim turpis a turpis duis."; |
+} |
+ |
-function f() { |
- throw new Error("test stack"); |
+var re = /omitted/; |
+ |
+try { |
+ veryLongString.nonexistentMethod(); |
+} catch (e) { |
+ assertTrue(e.message.length < 350); |
+ assertTrue(re.test(e.message)); |
} |
-var error_stack = ""; |
try { |
- f.call(null); |
+ veryLongString().nonexistentMethod(); |
} catch (e) { |
- error_stack = e.stack; |
+ assertTrue(e.message.length < 350); |
+ assertTrue(re.test(e.message)); |
} |
-assertTrue(error_stack.indexOf("test stack") > 0); |
-assertTrue(error_stack.indexOf("illegal") < 0); |
+try { |
+ throw Error(veryLongString()); |
+} catch (e) { |
+ assertEquals(veryLongString(), e.message); |
+} |