title: Proxy() block scope - Javascript
body: <p>I'm having trouble with the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy" rel="nofollow noreferrer">Proxy()</a> object in Javascript.</p>
  <p>This code is working as expected when I pass in a target and no handler:</p>
  <pre class="lang-js prettyprint-override"><code>const scope = new Proxy({a: 2, b: 2}, {});
  with (scope) {
      a + b;
  }
  </code></pre>
  <p>However, when I pass in a handler and no target, it does not work:</p>
  <pre class="lang-js prettyprint-override"><code>const scope = new Proxy({}, {get: function(){ return 2; }});
  with (scope) {
      a + b;
  }
  </code></pre>
  <p><code>scope.a == 2 &amp;&amp; scope.b == 2</code> evaluates to <code>true</code> in both cases.</p>