summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/array-reduce.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-06-29 17:26:51 +0200
committerRyan Dahl <ry@tinyclouds.org>2011-06-29 17:26:51 +0200
commit33af2720f26c2b25bc7f75ce7eb454ff99db6d35 (patch)
tree9a38f0c96420edf503eebd6325dd8d2d8249f653 /deps/v8/test/mjsunit/array-reduce.js
parent6afdca885adeeeed9eef8cbb01c3d97af0bc084d (diff)
downloadnode-new-33af2720f26c2b25bc7f75ce7eb454ff99db6d35.tar.gz
Upgrade V8 to 3.4.8
Diffstat (limited to 'deps/v8/test/mjsunit/array-reduce.js')
-rwxr-xr-xdeps/v8/test/mjsunit/array-reduce.js27
1 files changed, 18 insertions, 9 deletions
diff --git a/deps/v8/test/mjsunit/array-reduce.js b/deps/v8/test/mjsunit/array-reduce.js
index 83d9023a49..1e96188265 100755
--- a/deps/v8/test/mjsunit/array-reduce.js
+++ b/deps/v8/test/mjsunit/array-reduce.js
@@ -411,67 +411,77 @@ testReduce("reduceRight", "ArrayWithNonElementPropertiesReduceRight", 6,
// 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 @@ testReduce("reduce", "ArrayManipulationExtender", 10,
[3, 3, 2, [1, 2, 3, 4, 4, 5], 6],
[6, 4, 3, [1, 2, 3, 4, 4, 5, 6], 10],
], arr, extender, 0);
-