tag:blogger.com,1999:blog-34454975.post3451657859903089616..comments2023-06-28T16:58:41.189+02:00Comments on Web Reflection: [ECMAScript 5] Do Not Remove arguments.callee !Andrea Giammarchihttp://www.blogger.com/profile/16277820774810688474noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-34454975.post-20049090562106928302009-05-28T20:48:50.341+02:002009-05-28T20:48:50.341+02:00That's a good point. But still, passing arguments ...That's a good point. But still, passing arguments to another function allows that function to call args.callee when that may not be intended. The arguments object was meant only for arguments - nothing else.<br /><br />There was some discussion on ES4 about a "this function" syntax that would replace arguments.callee, e.g. "this function()". Not sure if that's going to be in ES-Harmony. I think ES-Harmony strict mode will try to deprecate the arguments object in preference for spread and rest, because of TCP and legacy arguments issues.<br /><br />In any case, this is hardly something that would "ruin JavaScript", considering that many libraries are already trying to conform to ES5 strict mode and many users aren't even aware of arguments.callee.Maianhttps://www.blogger.com/profile/06577384825391738376noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-39828423620463564462009-05-28T10:02:23.467+02:002009-05-28T10:02:23.467+02:00if that's the problem, callee not writable by defa...if that's the problem, callee not writable by default and that's it but still, both arguments and callee should not disappear, it will mean ruin JavaScript, IMO.Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-20969905215001905062009-05-28T09:46:22.213+02:002009-05-28T09:46:22.213+02:00See the ES working group's discussion on this ...See the ES working group's discussion on this issue: https://mail.mozilla.org/pipermail/es-discuss/2009-March/008970.html<br /><br />Essentially, it's common to pass on the arguments object to another function (e.g. for parsing the arguments), but it's not intended to allow that other function to modify arguments.callee.<br /><br />For example:<br /><br />function calleePolluter(args) {<br /> args.callee = null;<br />}<br /><br />(function(i) {<br /> if (i &lg; 0)<br /> return [];<br /> calleePolluter(arguments);<br /> return arguments.callee(i - 1).concat([i]);<br />})(5);<br /><br />The anonymous function call should produce [0,1,2,3,4,5], but calleePolluter modifies arguments.callee, causing the recursion to fail.<br /><br />Losing the ability to trace function calls via arguments.caller does suck - there's some discussion on standardizing Gecko's error.stack property or some equivalent.Maianhttps://www.blogger.com/profile/06577384825391738376noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-30519068971584189832009-05-27T03:59:27.712+02:002009-05-27T03:59:27.712+02:00This is a huge step backwards. Callee should be ke...This is a huge step backwards. Callee should be kept for sure. Is anyone aware of the supporting argument to remove it?Paul Irishhttps://www.blogger.com/profile/12055785626482615888noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-25410908857591566262009-05-24T13:45:51.825+02:002009-05-24T13:45:51.825+02:00I guess it is too late :(I guess it is too late :(Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-38814701047222582932009-05-24T13:23:22.209+02:002009-05-24T13:23:22.209+02:00Why not bring your view(s) to the mailing list?
h...Why not bring your view(s) to the mailing list?<br /><br />https://mail.mozilla.org/listinfo/es5-discussLars Gunther (itpastorn)https://www.blogger.com/profile/11544012919049072827noreply@blogger.com