madrobby/zepto — pull request #465 by gingertom (2012-04-03 17:44:46+00:00)
Title: Making 'data' behaviour more like jQuery, 2 changes and updated tests. 

I've made two changes that make Zepto more like the documentation and functionality of jQuery as Zepto is designed to be a drop in replacement for the functions it supports I consider this to be a positive change.

1st Change. When getting $elem.data("missing") on a real element but for a piece of data that was never set the old return value was null. However jQuery returns undefined. This change means that with or without the data extension the retuned value is now undefined.

2nd Change. This one is more controversial but I feel that it's the right thing to do. Currently when data is passed a function to store the function is immediately evaluated and the result of that function is stored, this is not what jQuery does and makes very inconvenient to store functions. This change allows for the storage of functions, in line with jQuery.

I've included updated test that reflect both of these changes.