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

Side by Side Diff: test/mjsunit/error-tostring-omit.js

Issue 271733005: Shorten autogenerated error message for functions only. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 6 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « src/messages.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 19 matching lines...) Expand all
30 "Nam vulputate metus est. Maecenas quis pellentesque eros," + 30 "Nam vulputate metus est. Maecenas quis pellentesque eros," +
31 "ac mattis augue. Nam porta purus vitae tincidunt blandit." + 31 "ac mattis augue. Nam porta purus vitae tincidunt blandit." +
32 "Aliquam lacus dui, blandit id consectetur id, hendrerit ut" + 32 "Aliquam lacus dui, blandit id consectetur id, hendrerit ut" +
33 "felis. Class aptent taciti sociosqu ad litora torquent per" + 33 "felis. Class aptent taciti sociosqu ad litora torquent per" +
34 "conubia nostra, per inceptos himenaeos. Ut posuere eros et" + 34 "conubia nostra, per inceptos himenaeos. Ut posuere eros et" +
35 "tempus luctus. Nullam condimentum aliquam odio, at dignissim" + 35 "tempus luctus. Nullam condimentum aliquam odio, at dignissim" +
36 "augue tincidunt in. Nam mattis vitae mauris eget dictum." + 36 "augue tincidunt in. Nam mattis vitae mauris eget dictum." +
37 "Nam accumsan dignissim turpis a turpis duis."; 37 "Nam accumsan dignissim turpis a turpis duis.";
38 } 38 }
39 39
40 assertTrue(veryLongString().length > 256);
40 41
41 var re = /omitted/; 42 var re = /...<omitted>.../;
42 43
43 try { 44 try {
44 veryLongString.nonexistentMethod(); 45 Number.prototype.toFixed.call(veryLongString);
45 } catch (e) { 46 } catch (e) {
46 assertTrue(e.message.length < 350); 47 assertTrue(e.message.length < 256);
47 // TODO(verwaest): Proper error message. 48 assertTrue(re.test(e.message));
48 // assertTrue(re.test(e.message));
49 } 49 }
50 50
51 try { 51 try {
52 veryLongString().nonexistentMethod();
53 } catch (e) {
54 assertTrue(e.message.length < 350);
55 // TODO(verwaest): Proper error message.
56 // assertTrue(re.test(e.message));
57 }
58
59 try {
60 throw Error(veryLongString()); 52 throw Error(veryLongString());
61 } catch (e) { 53 } catch (e) {
62 assertEquals(veryLongString(), e.message); 54 assertEquals(veryLongString(), e.message);
63 } 55 }
OLDNEW
« 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