From 7128bd3aa48bf2f5b0f51df125d3de57143d19c5 Mon Sep 17 00:00:00 2001 From: aynayayn Date: Fri, 11 Apr 2025 18:03:03 +0800 Subject: [PATCH] feat: update 1-js/99-js-misc/01-proxy/article.md --- 1-js/99-js-misc/01-proxy/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/99-js-misc/01-proxy/article.md b/1-js/99-js-misc/01-proxy/article.md index 1d152b909..a96760087 100644 --- a/1-js/99-js-misc/01-proxy/article.md +++ b/1-js/99-js-misc/01-proxy/article.md @@ -437,7 +437,7 @@ user = { ``` -对 `user.checkPassword()` 的调用会将被代理的对象 `user` 作为 `this`(点符号之前的对象会成为 `this`),因此,当它尝试访问 `this._password` 时,`get` 捕捉器将激活(在任何属性读取时,它都会被触发)并抛出错误。 +对 `user.checkPassword()` 的调用会将`Proxy`对象 `user` 作为 `this`(点符号之前的对象会成为 `this`),因此,当它尝试访问 `this._password` 时,`get` 捕捉器将激活(在任何属性读取时,它都会被触发)并抛出错误。 因此,我们在 `(*)` 行中将对象方法的上下文绑定到原始对象 `target`。然后,它们将来的调用将使用 `target` 作为 `this`,不会触发任何捕捉器。