Skip to content

Commit 95f1bb4

Browse files
author
James Halliday
committed
stub out .map()
1 parent 52e25d8 commit 95f1bb4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Diff for: index.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function createHarness (conf_) {
114114
function onend () {
115115
count--;
116116
if (this._progeny.length) {
117-
var unshifts = this._progeny.map(function (st) {
117+
var unshifts = map(this._progeny, function (st) {
118118
return function () {
119119
running = true;
120120
out.push(st);
@@ -152,4 +152,13 @@ function createHarness (conf_) {
152152
return test;
153153
}
154154

155+
function map (xs, f) {
156+
if (xs.map) return xs.map(f);
157+
var res = [];
158+
for (var i = 0; i < xs.length; i++) {
159+
res.push(f(xs[i]));
160+
}
161+
return res;
162+
}
163+
155164
// vim: set softtabstop=4 shiftwidth=4:

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name" : "tape",
3-
"version" : "0.3.2",
3+
"version" : "0.3.3",
44
"description" : "tap-producing test harness for node and browsers",
55
"main" : "index.js",
66
"bin" : "./bin/tape",

0 commit comments

Comments
 (0)