Properties set to __proto__ override directly defined properties in Chrome

With this html:

<select><option>hi</option></select>

<script type="text/javascript">

var select = document.getElementsByTagName("select")[0];

select.__proto__.setValue = "foo";
select.setValue = "bar";

alert(select.setValue);

</script>

In Firefox and Opera, the output is "bar", but in Chrome, the output is "foo". If I skip the definition __proto__, all browsers display a "bar".

How do I get Chrome (8.0) to display the value of an object for an object, rather than the value set on the prototype?

+3
source share
1 answer

As described in the comments above, this is allowed in the current version of Chrome.

+1
source

Source: https://habr.com/ru/post/1780230/


All Articles