mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
修改一点儿代码
proxy.foo = proxy // true 改为 proxy.foo === proxy // true
This commit is contained in:
parent
ea5f8d16d1
commit
9022f046e3
@ -386,7 +386,7 @@ const handler = {
|
|||||||
};
|
};
|
||||||
const proxy = new Proxy({}, handler);
|
const proxy = new Proxy({}, handler);
|
||||||
proxy.foo = 'bar';
|
proxy.foo = 'bar';
|
||||||
proxy.foo = proxy // true
|
proxy.foo === proxy // true
|
||||||
```
|
```
|
||||||
|
|
||||||
上面代码中,`set`方法的第四个参数`receiver`,总是返回`this`关键字所指向的那个对象,即`proxy`实例本身。
|
上面代码中,`set`方法的第四个参数`receiver`,总是返回`this`关键字所指向的那个对象,即`proxy`实例本身。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user