Skip to content

Commit fc39ef6

Browse files
committed
Conflicts fixed on "Proxy and Reflect" page and task in french language
1 parent d5fbccc commit fc39ef6

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

1-js/99-js-misc/01-proxy/01-error-nonexisting/task.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ user = wrap(user);
2727

2828
alert(user.name); // John
2929
*!*
30-
<<<<<<< HEAD
31-
alert(user.age); // ReferenceError: la propriété n'existe pas "age"
32-
=======
33-
alert(user.age); // ReferenceError: Property doesn't exist: "age"
34-
>>>>>>> 99e59ba611ab11319ef9d0d66734b0bea2c3f058
30+
alert(user.age); // ReferenceError: la propriété n'existe pas : "age"
3531
*/!*
3632
```

1-js/99-js-misc/01-proxy/article.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,8 @@ user = new Proxy(user, {
375375
}
376376
},
377377
*!*
378-
<<<<<<< HEAD
379-
deleteProperty(target, prop) { // intercepter la suppression de propriété
378+
deleteProperty(target, prop) { // pour intercepter la suppression de propriété
380379
*/!*
381-
=======
382-
deleteProperty(target, prop) { // to intercept property deletion
383-
*/!*
384-
>>>>>>> 99e59ba611ab11319ef9d0d66734b0bea2c3f058
385380
if (prop.startsWith('_')) {
386381
throw new Error("Access denied");
387382
} else {
@@ -442,11 +437,7 @@ user = {
442437
```
443438

444439

445-
<<<<<<< HEAD
446440
L'appel `user.checkPassword()` obtient l'`user` proxy comme `this` (l'objet avant le point devient `this`), donc quand il essaie d'accéder à `this._password`, le piège `get` s'active (il se déclenche sur n'importe quelle propriété lue) et génère une erreur.
447-
=======
448-
A call to `user.checkPassword()` gets proxied `user` as `this` (the object before dot becomes `this`), so when it tries to access `this._password`, the `get` trap activates (it triggers on any property read) and throws an error.
449-
>>>>>>> 99e59ba611ab11319ef9d0d66734b0bea2c3f058
450441

451442
Nous lions donc le contexte des méthodes objet à l'objet d'origine, `target`, dans la ligne `(*)`. Ensuite, leurs futurs appels utiliseront `target` comme `this`, sans aucun piège.
452443

0 commit comments

Comments
 (0)