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

Unified Diff: test/mjsunit/stack-traces.js

Issue 1510173002: Revert of Make Error.prototype.toString spec compliant; and fix various side-effect-free error printing metho… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « test/mjsunit/regress/regress-crbug-523308.js ('k') | test/test262/test262.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/stack-traces.js
diff --git a/test/mjsunit/stack-traces.js b/test/mjsunit/stack-traces.js
index ed16100de0ae0f921e26aaa7c5c5d7bf280f6b23..76b73b7233f39790cd610e5abcdd9a0cea25c088 100644
--- a/test/mjsunit/stack-traces.js
+++ b/test/mjsunit/stack-traces.js
@@ -213,11 +213,27 @@
Nasty.prototype.foo = function () { throw new RangeError(); };
var n = new Nasty();
n.__defineGetter__('constructor', function () { CONS_FAIL; });
- assertThrows(()=>n.foo(), RangeError);
+ var threw = false;
+ try {
+ n.foo();
+ } catch (e) {
+ threw = true;
+ assertTrue(e.stack.indexOf('<error: ReferenceError') != -1,
+ "ErrorsDuringFormatting didn't contain error: ReferenceError");
+ }
+ assertTrue(threw, "ErrorsDuringFormatting didn't throw");
+ threw = false;
// Now we can't even format the message saying that we couldn't format
// the stack frame. Put that in your pipe and smoke it!
ReferenceError.prototype.toString = function () { NESTED_FAIL; };
- assertThrows(()=>n.foo(), RangeError);
+ try {
+ n.foo();
+ } catch (e) {
+ threw = true;
+ assertTrue(e.stack.indexOf('<error>') != -1,
+ "ErrorsDuringFormatting didn't contain <error>");
+ }
+ assertTrue(threw, "ErrorsDuringFormatting didnt' throw (2)");
}
« no previous file with comments | « test/mjsunit/regress/regress-crbug-523308.js ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698