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

Unified Diff: test/mjsunit/harmony/reflect.js

Issue 1544793002: [tests] Fix bogus uses of assertThrows. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/harmony/proxies-with.js ('k') | test/mjsunit/mjsunit.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/reflect.js
diff --git a/test/mjsunit/harmony/reflect.js b/test/mjsunit/harmony/reflect.js
index 8f04a44803d92df4a96aacd64b1149c3bad78b04..8ee1227a443a1b002e77aefa68e6aa7ded3f9a41 100644
--- a/test/mjsunit/harmony/reflect.js
+++ b/test/mjsunit/harmony/reflect.js
@@ -87,7 +87,7 @@ function prepare(target) {
var a = { [Symbol.toPrimitive]: function() { return "bla" } };
var b = { [Symbol.toPrimitive]: function() { throw "gaga" } };
assertEquals(42, Reflect.get(target, a));
- assertThrows(function() { Reflect.get(target, b); }, "gaga");
+ assertThrowsEquals(function() { Reflect.get(target, b); }, "gaga");
})();
@@ -156,7 +156,7 @@ function prepare(target) {
var b = { [Symbol.toPrimitive]: function() { throw "gaga" } };
assertTrue(Reflect.set(target, a, 42));
assertEquals(42, target.bla);
- assertThrows(function() { Reflect.set(target, b, 42); }, "gaga");
+ assertThrowsEquals(function() { Reflect.set(target, b, 42); }, "gaga");
})();
@@ -297,7 +297,7 @@ function prepare(target) {
var a = { [Symbol.toPrimitive]: function() { return "bla" } };
var b = { [Symbol.toPrimitive]: function() { throw "gaga" } };
assertTrue(Reflect.has(target, a));
- assertThrows(function() { Reflect.has(target, b); }, "gaga");
+ assertThrowsEquals(function() { Reflect.has(target, b); }, "gaga");
})();
@@ -350,7 +350,7 @@ function prepare(target) {
var b = { [Symbol.toPrimitive]: function() { throw "gaga" } };
assertTrue(Reflect.defineProperty(target, a, {value: 42}));
assertEquals(target.bla, 42);
- assertThrows(function() { Reflect.defineProperty(target, b); }, "gaga");
+ assertThrowsEquals(function() { Reflect.defineProperty(target, b); }, "gaga");
})();
@@ -379,7 +379,7 @@ function prepare(target) {
var a = { [Symbol.toPrimitive]: function() { return "bla" } };
var b = { [Symbol.toPrimitive]: function() { throw "gaga" } };
assertTrue(Reflect.deleteProperty(target, a));
- assertThrows(function() { Reflect.deleteProperty(target, b); }, "gaga");
+ assertThrowsEquals(function() { Reflect.deleteProperty(target, b); }, "gaga");
})();
@@ -530,8 +530,7 @@ function prepare(target) {
var a = { [Symbol.toPrimitive]: function() { return "bla" } };
var b = { [Symbol.toPrimitive]: function() { throw "gaga" } };
assertEquals(42, Reflect.getOwnPropertyDescriptor(target, a).value);
- assertThrows(function() { Reflect.getOwnPropertyDescriptor(target, b); },
- "gaga");
+ assertThrowsEquals(() => Reflect.getOwnPropertyDescriptor(target, b), "gaga");
})();
« no previous file with comments | « test/mjsunit/harmony/proxies-with.js ('k') | test/mjsunit/mjsunit.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698