2 small fixes
This commit is contained in:
peachesontour 2020-06-29 21:22:47 -03:00 committed by GitHub
parent 340ce43421
commit 74caa865f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -840,7 +840,7 @@ So there's no such problem when proxying an array.
### Private fields
The similar thing happens with private class fields.
A similar thing happens with private class fields.
For example, `getName()` method accesses the private `#name` property and breaks after proxying:
@ -963,7 +963,7 @@ revoke();
alert(proxy.data); // Error
```
A call to `revoke()` removes all internal references to the target object from the proxy, so they are no more connected. The target object can be garbage-collected after that.
A call to `revoke()` removes all internal references to the target object from the proxy, so they are no longer connected. The target object can be garbage-collected after that.
We can also store `revoke` in a `WeakMap`, to be able to easily find it by a proxy object: