obj.js 346 B

12345678910111213141516
  1. var assert = require('assert');
  2. var Traverse = require('traverse');
  3. exports['traverse an object with nested functions'] = function () {
  4. var to = setTimeout(function () {
  5. assert.fail('never ran');
  6. }, 1000);
  7. function Cons (x) {
  8. clearTimeout(to);
  9. assert.equal(x, 10);
  10. };
  11. Traverse(new Cons(10));
  12. };