Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1004)

Unified Diff: test/mjsunit/error-tostring-omit.js

Issue 88393002: Shorten autogenerated error message. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+}
« no previous file with comments | « src/messages.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698