-
Bug
-
Resolution: Fixed
-
P2
-
8
-
None
-
b93
-
Verified
A function defined in an Object prototype is called bind on it in the Object constructor. This is creating a TypeError: Cannot read property "bind" from undefined.
What is strange is that, if no bind method is called, the method is not undefined and can be called. As soon as bind is called (although being called as the last instruction), method is undefined.
Testcase:
function MyObject() { // If the call to bind is removed, then the function is properly printed. print("function " + this._process); this._process = this._process.bind(this); }
MyObject.prototype._process = function() { print("Message "); }
var s = new MyObject();
What is strange is that, if no bind method is called, the method is not undefined and can be called. As soon as bind is called (although being called as the last instruction), method is undefined.
Testcase:
function MyObject() { // If the call to bind is removed, then the function is properly printed. print("function " + this._process); this._process = this._process.bind(this); }
MyObject.prototype._process = function() { print("Message "); }
var s = new MyObject();