diff --git a/lib/traverse.js b/lib/traverse.js index d8eae1d..b10e657 100644 --- a/lib/traverse.js +++ b/lib/traverse.js @@ -11,6 +11,9 @@ function Traverse (refObj) { Object.keys(ref).forEach(function (key) { node[key] = clone(ref[key]); }); + // To make instanceof work: + if ('__proto__' in ref) node.__proto__ = ref.__proto__; + // Probably there are other attributes worth copying return node; } else {