Skip to content

Commit 43a5e5f

Browse files
author
wendy@lastlookeditorial.com
committed
Edited ch06.asciidoc with Atlas code editor
1 parent 2b50aca commit 43a5e5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ch06.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ We've already covered `get`, which traps property access; and `set`, which traps
295295

296296
==== has Trap
297297

298-
We can use `handler.has` to conceal any property you want when it comes to the `in` operator. In the `set` trap code samples we prevented changes and even access to properties with a certain prefix, but unwanted accessors could still probe the `proxy` to figure out whether these properties exist. There are three alternatives here:
298+
We ((("proxies", "has trap", id="prox6ht")))((("traps", "has trap", id="t6ht")))can use `handler.has` to conceal any property you want when it comes to the `in` operator. In the `set` trap code samples we prevented changes and even access to properties with a certain prefix, but unwanted accessors could still probe the `proxy` to figure out whether these properties exist. There are three alternatives here:
299299

300300
- Do nothing, in which case `key in proxy` falls through to `Reflect.has(target, key)`, the equivalent of `key in target`
301301
- Return `true` or `false` regardless of whether `key` is or is not present in `target`
@@ -360,7 +360,7 @@ console.log(proxy.hasOwnProperty('_secret'))
360360
// <- true
361361
----
362362

363-
The `getOwnPropertyDescriptor` trap in <<getownpropertydescriptor_trap>> offers a solution that's able to intercept `Object#hasOwnProperty` as well.
363+
The `getOwnPropertyDescriptor` trap in <<getownpropertydescriptor_trap>> offers a ((("proxies", "has trap", startref="prox6ht")))((("traps", "has trap", startref="t6ht")))solution that's able to intercept `Object#hasOwnProperty` as well.
364364

365365
==== deleteProperty Trap
366366

0 commit comments

Comments
 (0)