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

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

Issue 1507273002: 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
Index: test/mjsunit/stack-traces.js
diff --git a/test/mjsunit/stack-traces.js b/test/mjsunit/stack-traces.js
index 76b73b7233f39790cd610e5abcdd9a0cea25c088..ed16100de0ae0f921e26aaa7c5c5d7bf280f6b23 100644
--- a/test/mjsunit/stack-traces.js
+++ b/test/mjsunit/stack-traces.js
@@ -213,27 +213,11 @@ function testErrorsDuringFormatting() {
Nasty.prototype.foo = function () { throw new RangeError(); };
var n = new Nasty();
n.__defineGetter__('constructor', function () { CONS_FAIL; });
- 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;
+ assertThrows(()=>n.foo(), RangeError);
// 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; };
- try {
- n.foo();
- } catch (e) {
- threw = true;
- assertTrue(e.stack.indexOf('<error>') != -1,
- "ErrorsDuringFormatting didn't contain <error>");
- }
- assertTrue(threw, "ErrorsDuringFormatting didnt' throw (2)");
+ assertThrows(()=>n.foo(), RangeError);
}

Powered by Google App Engine
This is Rietveld 408576698