From eb4e2c998c38b6b9e857311e2e829c155b1b3214 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Thu, 30 Jul 2015 01:06:49 -0400 Subject: [PATCH] Fix Proxy examples the [[Get]] internal slot of Proxy [calls the handler](http://www.ecma-international.org/ecma-262/6.0/index.html#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver) with `target`, `P`, and `receiver` as arguments. the [[Call]] internal slot [calls the handler] with `thisArgument` and an `argsList` which is an Array made from the argumentsList. You don't need to use a rest parameter there. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eb4307f..6b9c4bf 100644 --- a/README.md +++ b/README.md @@ -395,8 +395,8 @@ Proxies enable creation of objects with the full range of behaviors available to // Proxying a normal object var target = {}; var handler = { - get: function (receiver, name) { - return `Hello, ${name}!`; + get: function (target, property, receiver) { + return `Hello, ${property}!`; } }; @@ -408,7 +408,7 @@ p.world === 'Hello, world!'; // Proxying a function object var target = function () { return 'I am the target'; }; var handler = { - apply: function (receiver, ...args) { + apply: function (thisArg, args) { return 'I am the proxy'; } };