Standardize getter return values for empty sets.
|Reported by:||cowboy||Owned by:|
Description (last modified by cowboy)
Just like getter-setter detection logic has been standardized on arguments, it might be a good idea for empty-set getters to always return a consistent value. I vote for null.
I also understand if .text() must continue to behave differently, because it's already a special case in other ways, and we need something to laugh at ironically.
$.fn.jquery // "1.7.2" $().attr("x") // undefined $().prop("x") // undefined $().css("x") // undefined $().val() // undefined $().text() // "" $().html() // null $().offset() // null
Please don't do this in a patch release, though! <3 (zing)
Change History (3)
comment:1 Changed 4 years ago by cowboy
- Description modified (diff)
- Summary changed from Standardize getter return values on empty set. to Standardize getter return values for empty sets.
comment:2 Changed 4 years ago by dmethvin
- Component changed from unfiled to attributes
- Milestone changed from None to 1.8
- Priority changed from undecided to low
- Status changed from new to open