We already have this https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/lang/type.js#L39