490431e7acd54310a0e4ee5486a64368c68ef284
[platform/framework/web/crosswalk-tizen.git] /
1 'use strict';
2
3 var o = { 1: 1, 2: 2, 3: 3 };
4
5 module.exports = function (t, a) {
6         var o2 = {}, i = 0;
7         t(o, function (value, name) {
8                 o2[name] = value;
9                 return false;
10         });
11         a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
12
13         a(t(o, function () {
14                 ++i;
15                 return true;
16         }), true, "Succeeds");
17         a(i, 1, "Stops iteration after condition is met");
18
19         a(t(o, function () {
20                 return false;
21         }), false, "Fails");
22
23 };