madrobby/zepto — pull request #800 by igorescobar (2013-08-18 03:40:10+00:00)
Title: jQuery Compatibility Increase

Hi guys,

I did a little change on zepto's val(), text() and html() method to make it work more closer to how jQuery works and understand when you're passing an argument or not. jQuery still understand undefined as a valid argument.

Ex:
val() returns a string
val(value) returns the object itself

Originally Zepto do not consider undefined as a value and jQuery does. It result on a inconsistency between Zepto.js and jQuery.

jQuery:
* .val() returns a string.
* .val('a') returns the object itself.
* .val(undefined) returns the object itself.

Zepto.js:
* .val() returns a string.
* .val('a') returns the object itself.
* .val(undefined) returns a stirng.

Thanks!