appcelerator/hyperloop-common — pull request #30 by infosia (2014-06-20 01:14:47+00:00)
Title: Fix: Let types to check null pointer

* #29 causes compile error on non-object types like System.Enum on Windows.
* Add null pointer check to Type.
* Not all types can handle nullptr, so let types to decide how to react to it
* override Type.toNullCheck to customize

```javascript
Type.prototype.toNullCheck = function(varname, indent, code) {
code.push(indent+'if ('+varname+' == nullptr)');
code.push(indent+'{');
code.push(indent+'\treturn JSValueMakeNull(ctx);');
code.push(indent+'}');
}
```