title: Proxy - handler.ownKeys() - nested object
body: <p>How can I handle all traps for ownKeys in a nested object? </p>
  
  <p>I only know how to handle one level deep object:</p>
  
  <pre><code>function wrap(obj, fn) {
    var handler = {
      ownKeys(target) {
        fn(target)
        return target
      }
    }
    return new Proxy(obj, handler)
  }
  
  var origObj = {
    a: {
      b: {
       c: 0
      }
    }
  }
  
  var wrappedObj = wrap(origObj, console.log)
  
  Object.keys(wrappedObj) // =&gt; actual = expected: { a: { b: { c: 0 } } }
  Object.keys(wrappedObj.a) // =&gt; actual: not working, expected: { b: { c: 0 } }
  Object.keys(wrappedObj.a.b) // =&gt; actual: not working, expected: { c: 0 }
  </code></pre>
  
  <p><strong>edit 1:</strong></p>
  
  <p>If I try to wrap each inner object (from this <a href="https://stackoverflow.com/a/45978003/7027774">answer</a>) then it logs all steps not just the last one. By "all steps" I mean the inner process of the proxy which goes through the whole nested object so it fires <code>fn(target)</code> multiple times but I want to fire it only once.</p>
  
  <p><a href="https://i.stack.imgur.com/I6UCg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I6UCg.png" alt="Output in the console"></a></p>
  
  <p><strong>edit 2:</strong> </p>
  
  <p>So it looks that the problem is with the node environmnent (node version 8.1.4) where <code>proxy</code> looks broken. In the chrome console is everything ok.</p>