title: different behavior es6 Proxy on NodeJs and Web when return in class constructor that extends
body: <pre class="lang-js prettyprint-override"><code>import * as Parse from 'parse';
  import { Object as ParseObject } from 'parse';
  export interface IItem {
    num: number;
  }
  export class Item extends ParseObject&lt;IItem&gt; implements IItem {
   num = 1;
    constructor(attributes?: IItem) {
      super('Item', attributes!);
      return new Proxy&lt;Item&gt;(this, /*this handles may empty {} but keep this way for verbosity*/{
        set: (a, b, c, d): boolean =&gt; {
          return Reflect.set(a, b, c, d);
        },
        construct: (a, b, c): any =&gt; {
          // eslint-disable-next-line @typescript-eslint/ban-types
          return Reflect.construct(a as unknown as Function, b, c);
        },
        get: (a, b, c): any =&gt; {
          return Reflect.get(a, b, c);
        },
        apply: (a, b, c): any =&gt; {
          // eslint-disable-next-line @typescript-eslint/ban-types
          return Reflect.apply(a as unknown as Function, b, c);
        },
        defineProperty: (a, b, c): any =&gt; {
          return Reflect.defineProperty(a, b, c);
        },
        getPrototypeOf: (t): any =&gt; {
          return Reflect.getPrototypeOf(t);
        },
        deleteProperty: (a, b): any =&gt; {
          return Reflect.deleteProperty(a, b);
        },
        has: (a, b): any =&gt; {
          return Reflect.has(a, b);
        },
        ownKeys: (t): any =&gt; {
          return Reflect.ownKeys(t);
        },
        getOwnPropertyDescriptor: (a, b): any =&gt; {
          return Reflect.getOwnPropertyDescriptor(a, b);
        },
        isExtensible: (t): any =&gt; {
          return Reflect.isExtensible(t);
        },
        preventExtensions: (t): any =&gt; {
          return Reflect.preventExtensions(t);
        },
        setPrototypeOf: (a, b): any =&gt; {
          return Reflect.setPrototypeOf(a, b);
        },
      });
    }
  
  }
  const ite /*Proxy of Item*/ = new Item({ num: 980 });
  console.log('get num', ite.get('num')); // should return `980`
  </code></pre>
  <p>The code describes the usage of a proxy in a constructor.</p>
  <p>Getter and Setters work as spected but the inherited properties from <code>extends ParseObject</code> do not.</p>
  <p>The get function retrieves objects from the ParseObject.attributes <a href="https://docs.parseplatform.org/js/guide/#parseobject" rel="nofollow noreferrer">https://docs.parseplatform.org/js/guide/#parseobject</a> so is the same as <code>ParseObject.attributes.num</code> === <code>ParseObject.get('num')</code></p>
  <p>I implemented this patter to get a js Class to behave as a parse object without calling the <code>ParseObject.set('prop')</code>. On web browsers, raw or transpiled in angular works as spected.</p>
  <pre class="lang-js prettyprint-override"><code>ite.get('num') // returns `980`
  ite.attributes // returns `{ num: 980 }`
  </code></pre>
  <p>But in NodeJs, transpiled from typescript and raw typescript, bundled with webpack, rollup.</p>
  <pre class="lang-js prettyprint-override"><code>ite.get('num') // returns `undefined`
  ite.attributes // returns `{}`
  </code></pre>
  <p>I don't get the mistake. If someone can explain why this happens to figure a workarround in NodeJs for this proxy constructor approach that works on web but not on node </p>