Closed
Bug 1346500
Opened 8 years ago
Closed 5 years ago
The result of the polyfill doesn't meet the result of firefox.
Categories
(Developer Documentation Graveyard :: JavaScript, enhancement, P5)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: blackmiaool, Unassigned)
References
()
Details
:: Developer Documentation Request
Request Type: Correction
Gecko Version: 50 Branch
Technical Contact:
:: Details
I created a codepen to explain the problem: http://codepen.io/blackmiaool/pen/Vpbava?editors=1111.
The code is like below:
function a() {};
var c = a.bind();
Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function() {},
fBound = function() {
return fToBind.apply(this instanceof fNOP ?
this :
oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
if (this.prototype) {
// Function.prototype doesn't have a prototype property
fNOP.prototype = this.prototype;
}
fBound.prototype = new fNOP();
return fBound;
};
var d = a.bind();
console.log(c.prototype,d.prototype);
Comment 1•5 years ago
|
||
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•