Skip to content

Commit

Permalink
stub out .map()
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Apr 1, 2013
1 parent 52e25d8 commit 95f1bb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function createHarness (conf_) {
function onend () {
count--;
if (this._progeny.length) {
var unshifts = this._progeny.map(function (st) {
var unshifts = map(this._progeny, function (st) {
return function () {
running = true;
out.push(st);
Expand Down Expand Up @@ -152,4 +152,13 @@ function createHarness (conf_) {
return test;
}

function map (xs, f) {
if (xs.map) return xs.map(f);
var res = [];
for (var i = 0; i < xs.length; i++) {
res.push(f(xs[i]));
}
return res;
}

// vim: set softtabstop=4 shiftwidth=4:
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "tape",
"version" : "0.3.2",
"version" : "0.3.3",
"description" : "tap-producing test harness for node and browsers",
"main" : "index.js",
"bin" : "./bin/tape",
Expand Down

0 comments on commit 95f1bb4

Please sign in to comment.