Fix bug in process.mixin where deep copies would not work at all.
authorBenjamin Thomas <benjamin@benjaminthomas.org>
Mon, 22 Feb 2010 06:47:15 +0000 (06:47 +0000)
committerRyan Dahl <ry@tinyclouds.org>
Mon, 22 Feb 2010 06:51:23 +0000 (22:51 -0800)
commit49cd1bbf84271f5a59954a176fc79a99814afa8b
tree7977c3bffccdd918fab206e074cf7fadcc2fbff1
parent4c8889bba2a06d77b8e5835e70e10e3f9b412d6f
Fix bug in process.mixin where deep copies would not work at all.

Before, doing this:

    var sys = require("sys");

    var obj = {
      one: 1,
      two: 2,
      three: {
        value: 3
      }
    };

    sys.p(process.mixin(true, {}, obj));

Would output this:

    {
     "two": 2,
     "three": {
      "one": 1,
      "two": 2,
      "three": {
       "value": 3
      },
      "value": 3
     },
     "one": 1
    }

When it should have outputed this:

    {
     "one": 1,
     "two": 2,
     "three": {
      "value": 3
     }
    }
src/node.js
test/mjsunit/test-process-mixin.js