It is replaced with same function different name, so what is the point of this? I was trying to find something on Google, but it is spammed with the "fear of warnings"...
No, I don't have any problem with this warning. I am wondering why to replace existing function with a new one if the output result is the same in the end...

- 9,694
- 3
- 36
- 71
-
1What is the point of your question? Where is your problem? What is your approach and what are the errors? – Jurik Apr 11 '14 at 15:49
-
2@j08691: None of the answers there explain why it was deprecated (and neither did that asker seem interested in knowing). You'd think someone would have answered that by now... – BoltClock Apr 11 '14 at 15:56
-
@Jurik I am just wondering why they did the new function... – Akxe Apr 11 '14 at 16:14
1 Answers
In the patch to Chromium that added the deprecated warning, they wrote the following as to why they were deprecating it:
Note that this patch also deprecates Event.returnValue. This used to be an IE extension but this is no longer supported by IE (nor Firefox). The standard preventDefault() should be used instead (supported in IE >= 9).
So now that IE is moving away from using that, they want people to start cleaning up their code to use the standard property, so that it can eventually be removed completely.
In a comment in the code review for the patch, it looks like the developer was going to just remove support altogether in Chrome, but found some places it was still being used and shifted to just throwing a deprecation warning instead.

- 10,139
- 5
- 38
- 50
-
So `Event.returnValue` wasn't never actually standardized? Or why removing the function anyway? – Akxe Apr 11 '14 at 16:21
-
I don't really know the history of it -- just going by that comment. But as with many things web-related, it's probable that IE did things that way originally, and then other browsers which came along later after a standard was created had to support both the correct way, and the old IE way so that JS code written for IE wouldn't break. – patmortech Apr 11 '14 at 16:29
-
As for removing it, it's always a good idea to get rid of stuff in your codebase that is no longer used so that you don't have to think about it when making changes or adding features. It's easier to support one common way of doing things than to have multiple slightly different ways with no benefit. – patmortech Apr 11 '14 at 16:31
-