madrobby/zepto — pull request #439 by i8ramin (2012-03-15 16:06:22+00:00)
Title: basic code cleanup. adding semicolons, error checking, etc.

Adding semicolons where appropriate. Also checking for existence of properties before they are accessed.

Just curious, but why does the source code not make proper usage of curly's in if/else blocks and loops? Since we are minimizing the code using google closure compiler during the build process, it seems unnecessary to try and save those extra bytes by not using them. It makes the code a bit hard to read and too clever for its own good (IMHO).

for example:

``` javascript
if (isA(selector)) dom = compact(selector);
else if (elementTypes.indexOf(selector.nodeType) >= 0 || selector === window)
dom = [selector], selector = null;
else if (fragmentRE.test(selector))
dom = fragment(selector.trim(), RegExp.$1), selector = null;
else if (selector.nodeType && selector.nodeType == 3) dom = [selector];
else dom = $$(document, selector);
```

Very difficult to read and also error prone. The use of comma expressions (``` dom = [selector], selector = null; ```) could be problematic.