Skip to content

Commit

Permalink
passing test for stop map too hooray
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 10, 2011
1 parent 79d615f commit 0ee24cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/stop.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ exports.stop = function () {

assert.equal(visits, 5);
};

exports.stopMap = function () {
var s = traverse('abcdefghij'.split('')).map(function (node) {
if (typeof node === 'string') {
if (node === 'e') this.stop()
return node.toUpperCase();
}
}).join('');

assert.equal(s, 'ABCDEfghij');
};

0 comments on commit 0ee24cc

Please sign in to comment.