Jason Orendorff jason.orendorff at
Mon Mar 16 18:15:09 UTC 2015

On Mon, Mar 16, 2015 at 11:53 AM, Allen Wirfs-Brock
<allen at> wrote:
> In ES6, the primary role of the Reflect object is to provide direct access
> to an object's essential internal methods:

To further elaborate on this: one way this is useful is that the 14
essential internal methods are exactly the operations you can trap
with a custom Proxy. It's useful, when writing a Proxy, to use the
Reflect methods as fallbacks:

    var alertingProxy = new Proxy(obj, {
        // Proxy: hook into property assignment
        set(t, key, value, receiver) {
            alert(`setting the ${key} property of ${t} to ${value}`);

            // Reflect: do normal property assignment
            return Reflect.set(t, key, value, receiver);


More information about the es-discuss mailing list