commit
e62dfd5254
1 changed files with 1 additions and 1 deletions
|
@ -220,7 +220,7 @@ alert(obj.__proto__); // [object Object], didn't work as intended
|
||||||
|
|
||||||
As we see from the code, the assignment to a primitive `5` is ignored.
|
As we see from the code, the assignment to a primitive `5` is ignored.
|
||||||
|
|
||||||
That can become a source of bugs and even vulnerabilies if we intend to store arbitrary key-value pairs in an object, and allow a visitor to specify the keys.
|
That can become a source of bugs and even vulnerabilities if we intend to store arbitrary key-value pairs in an object, and allow a visitor to specify the keys.
|
||||||
|
|
||||||
In that case the visitor may choose "__proto__" as the key, and the assignment logic will be ruined (as shown above).
|
In that case the visitor may choose "__proto__" as the key, and the assignment logic will be ruined (as shown above).
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue