FIX access to the prototype of an instance (#6005)
The right way access to the prototype of an instance is using the `__proto__` rather than the `prototype`.
This commit is contained in:
committed by
Justin Ridgewell
parent
fe13ba8fc2
commit
4d51052037
@@ -24,7 +24,7 @@ Below is a class with four class properties which will be transformed.
|
||||
let myBork = new Bork;
|
||||
|
||||
//Property initializers are not on the prototype.
|
||||
console.log(myBork.prototype.boundFunction); // > undefined
|
||||
console.log(myBork.__proto__.boundFunction); // > undefined
|
||||
|
||||
//Bound functions are bound to the class instance.
|
||||
console.log(myBork.boundFunction.call(undefined)); // > "bork"
|
||||
|
||||
Reference in New Issue
Block a user