Closed bertho-zero closed 3 years ago
The same may be happening with function.name
, I haven't checked.
Hm, so according to MDN the property is not writeable but configurable. I tested this and it looked like it worked (but not sure if that applies to all engines):
function blabla (a, b, c) {}
Object.defineProperty(blabla, 'length', { value: 5 })
console.log(blabla.length);
The configurable seems newer than the function.length, and still not supported on IE.
This redefinition of length and name must be in a try catch in my opinion.
As expected, it's broken in IE.
function.length
is lost, and I see an error callinghooks
without hooks argument.