Enhance Prototype.BrowserFeatures detections with type checking
Reported by John-David Dalton | June 24th, 2008 @ 03:21 PM
Garrett Smith pointed out that:
"SpecificElementExtensions could be true when document.createElement('form').__proto__ is undefined and document.createElement('div').__proto__ is Object.prototype. "
I have patched the various checks in Prototype.BrowserFeatures to provide more accurate results.
Comments and changes to this ticket
-
Juriy Zaytsev June 24th, 2008 @ 07:49 PM
- → State changed from bug to new
I'd like to know when these cases happen and how come this was never reported before. Also, typeof will return "object" for null values (though I'm not sure if __proto__ ever returns null).
-
John-David Dalton June 24th, 2008 @ 07:53 PM
I don't think these cases have happened I think Garrett was proving a point that since these are none standard you shouldn't assume anything about them (them not equaling null) is part of that... I will adjust this a bit more.
-
Juriy Zaytsev June 24th, 2008 @ 11:26 PM
I'm still not convinced that we actually need this.
Failing test case (or at least a name of environment where this detection breaks) would be nice to look at.
-
John-David Dalton June 25th, 2008 @ 12:51 AM
Making checks and conditions more accurate is pretty convincing for me :P
-
Juriy Zaytsev June 25th, 2008 @ 01:57 AM
- → Milestone changed from 1.6.0.3 to 1.6.1
: )
There are tens of places where we could add "checks and conditions". All of them could be thought of as "necessary" (or not). I'm not arguing against this particular change (since variable is only set once and it barely affects performance). It just seems like a premature optimization to me - there's no failing test case, not even a mention of which browsers/platforms fail.
-
John-David Dalton June 25th, 2008 @ 02:30 PM
Ya I see your point. Maybe the tweaking is a bit of an overkill.
-
John-David Dalton June 25th, 2008 @ 02:31 PM
- → Tag changed from to needs_tests patched
- → Milestone cleared.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
The Prototype JavaScript library.
