Hi,
What web browsers use the __proto__? Mozilla states that:
Note that
__proto__may not be available in JavaScript versions other than that in Mozilla.
Hi,
What web browsers use the __proto__? Mozilla states that:
Note that
__proto__may not be available in JavaScript versions other than that in Mozilla.
The end of the sentence you posted is See below for workarounds., where there is a discussion on an alternative method extends() that uses super.prototype:
function extend(child, super){
for (var property in super.prototype) {
if (typeof child.prototype[property] == "undefined")
child.prototype[property] = super.prototype[property];
}
return child;
}
The Browser Security Handbook has a table showing which browsers expose __proto__.
Currently, those browsers are:
Those excluded:
Click here for your answer.
Details
The most general way would be to test this page in different browsers:
<html>
<head>
<script type="text/javascript">
function a() {}
if ( (new a).__proto__ === a.prototype )
alert('supported');
</script>
</head>
</html>
It alerts if a browser supports __proto__. I've submitted it to browsershots.org, which will create screenshots of the page in many different browsers. Thus, you should see--by means of the alert message--which browser does support it.