you could just use: https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/util/object.js#L30