Skip to content

Commit

Permalink
avoid another use of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Nov 25, 2012
1 parent d4763c2 commit e2fcccb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/zepto.js
Expand Up @@ -545,9 +545,10 @@ var Zepto = (function() {
},
val: function(value){
return (value === undefined) ?
(this.length > 0 ?
(this[0].multiple ? $(this[0]).find('option').filter(function(o){ return this.selected }).pluck('value') : this[0].value) :
undefined) :
(this[0] && (this[0].multiple ?
$(this[0]).find('option').filter(function(o){ return this.selected }).pluck('value') :
this[0].value)
) :
this.each(function(idx){
this.value = funcArg(this, value, idx, this.value)
})
Expand Down

0 comments on commit e2fcccb

Please sign in to comment.