Skip to content

Commit

Permalink
subexpressions from update()s shouldn't be traversed, failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 11, 2011
1 parent 9aea0a1 commit be2b574
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/subexpr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var traverse = require('traverse');
var assert = require('assert');

exports.subexpr = function () {
var obj = [ 'a', 4, 'b', 5, 'c', 6 ];
var r = traverse(obj).map(function (x) {
if (typeof x === 'number') {
this.update([ x - 0.1, x, x + 0.1 ]);
}
});
};

0 comments on commit be2b574

Please sign in to comment.