summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js')
-rw-r--r--test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js29
1 files changed, 12 insertions, 17 deletions
diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js
index bd392b800..6fac3bfd8 100644
--- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js
+++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-7.js
@@ -10,25 +10,20 @@ description: >
(toString)), no initVal
---*/
-foo.prototype = new Array(1, 2, 3);
+ foo.prototype = new Array(1, 2, 3);
+ function foo() {}
+ var f = new foo();
-function foo() {}
-var f = new foo();
+ var o = { toString: function () { return '0';}};
+ f.length = o;
-var o = {
- toString: function() {
- return '0';
- }
-};
-f.length = o;
+ // objects inherit the default valueOf method of the Object object;
+ // that simply returns the itself. Since the default valueOf() method
+ // does not return a primitive value, ES next tries to convert the object
+ // to a number by calling its toString() method and converting the
+ // resulting string to a number.
-// objects inherit the default valueOf method of the Object object;
-// that simply returns the itself. Since the default valueOf() method
-// does not return a primitive value, ES next tries to convert the object
-// to a number by calling its toString() method and converting the
-// resulting string to a number.
-
-function cb() {}
+ function cb(){}
assert.throws(TypeError, function() {
- f.reduceRight(cb);
+ f.reduceRight(cb);
});