summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js')
-rw-r--r--test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js38
1 files changed, 21 insertions, 17 deletions
diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js
index 160a4ea8e..4994164fd 100644
--- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js
+++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js
@@ -9,27 +9,31 @@ description: >
accessor property without a get function on an Array-like object
---*/
- var testResult = false;
- var initialValue = 0;
- function callbackfn(prevVal, curVal, idx, obj) {
- if (idx === 1) {
- testResult = (curVal === undefined);
- }
- }
+var testResult = false;
+var initialValue = 0;
- var proto = { 0: 0, 2: 2 };
+function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (curVal === undefined);
+ }
+}
- Object.defineProperty(proto, "1", {
- set: function () { },
- configurable: true
- });
+var proto = {
+ 0: 0,
+ 2: 2
+};
- var Con = function () { };
- Con.prototype = proto;
+Object.defineProperty(proto, "1", {
+ set: function() {},
+ configurable: true
+});
- var child = new Con();
- child.length = 3;
+var Con = function() {};
+Con.prototype = proto;
- Array.prototype.reduce.call(child, callbackfn, initialValue);
+var child = new Con();
+child.length = 3;
+
+Array.prototype.reduce.call(child, callbackfn, initialValue);
assert(testResult, 'testResult !== true');