summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js')
-rw-r--r--test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js29
1 files changed, 12 insertions, 17 deletions
diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js
index 735d1c856..a411f9467 100644
--- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js
+++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js
@@ -9,25 +9,20 @@ description: >
property without a get function on an Array-like object
---*/
-var testResult = false;
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === undefined);
+ }
+ }
-function callbackfn(prevVal, curVal, idx, obj) {
- if (idx === 1) {
- testResult = (prevVal === undefined);
- }
-}
+ var obj = { 1: 1, 2: 2, length: 3 };
-var obj = {
- 1: 1,
- 2: 2,
- length: 3
-};
+ Object.defineProperty(obj, "0", {
+ set: function () { },
+ configurable: true
+ });
-Object.defineProperty(obj, "0", {
- set: function() {},
- configurable: true
-});
-
-Array.prototype.reduce.call(obj, callbackfn);
+ Array.prototype.reduce.call(obj, callbackfn);
assert(testResult, 'testResult !== true');