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

Unified Diff: test/mjsunit/array-reduce.js

Issue 7348008: Merge up to 8597 to experimental/gc from the bleeding edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 5 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/arguments-escape.js ('k') | test/mjsunit/array-sort.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-reduce.js
===================================================================
--- test/mjsunit/array-reduce.js (revision 8618)
+++ test/mjsunit/array-reduce.js (working copy)
@@ -411,67 +411,77 @@
// Test error conditions:
+var exception = false;
try {
[1].reduce("not a function");
- assertUnreachable("Reduce callback not a function not throwing");
} catch (e) {
+ exception = true;
assertTrue(e instanceof TypeError,
"reduce callback not a function not throwing TypeError");
assertEquals("called_non_callable", e.type,
"reduce non function TypeError type");
}
+assertTrue(exception);
+exception = false;
try {
[1].reduceRight("not a function");
- assertUnreachable("ReduceRight callback not a function not throwing");
} catch (e) {
+ exception = true;
assertTrue(e instanceof TypeError,
"reduceRight callback not a function not throwing TypeError");
assertEquals("called_non_callable", e.type,
"reduceRight non function TypeError type");
}
+assertTrue(exception);
-
+exception = false;
try {
[].reduce(sum);
- assertUnreachable("Reduce no initial value not throwing");
} catch (e) {
+ exception = true;
assertTrue(e instanceof TypeError,
"reduce no initial value not throwing TypeError");
assertEquals("reduce_no_initial", e.type,
"reduce no initial TypeError type");
}
+assertTrue(exception);
+exception = false;
try {
[].reduceRight(sum);
- assertUnreachable("ReduceRight no initial value not throwing");
} catch (e) {
+ exception = true;
assertTrue(e instanceof TypeError,
"reduceRight no initial value not throwing TypeError");
assertEquals("reduce_no_initial", e.type,
"reduceRight no initial TypeError type");
}
+assertTrue(exception);
-
+exception = false;
try {
[,,,].reduce(sum);
- assertUnreachable("Reduce sparse no initial value not throwing");
} catch (e) {
+ exception = true;
assertTrue(e instanceof TypeError,
"reduce sparse no initial value not throwing TypeError");
assertEquals("reduce_no_initial", e.type,
"reduce no initial TypeError type");
}
+assertTrue(exception);
+exception = false;
try {
[,,,].reduceRight(sum);
- assertUnreachable("ReduceRight sparse no initial value not throwing");
} catch (e) {
+ exception = true;
assertTrue(e instanceof TypeError,
"reduceRight sparse no initial value not throwing TypeError");
assertEquals("reduce_no_initial", e.type,
"reduceRight no initial TypeError type");
}
+assertTrue(exception);
// Array changing length
@@ -511,4 +521,3 @@
[3, 3, 2, [1, 2, 3, 4, 4, 5], 6],
[6, 4, 3, [1, 2, 3, 4, 4, 5, 6], 10],
], arr, extender, 0);
-
« no previous file with comments | « test/mjsunit/arguments-escape.js ('k') | test/mjsunit/array-sort.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698