I am wondering that how Google’s Closure Compiler works. Can I, for instance, make it convert function calls like:
if (MyApp.isArray(...)) {
// foobar
}
to the actual implementation:
if ((typeof sthing === 'Object' && sthing.constructor.toString().indexOf("Array") !== -1))
I am asking this because I have a lot of wrappers that tie some functionality, and I would like Closure Compiler to convert them back to having one less function call.
Actually, does one extra function call make an app any more slower visibly?
Most likely not, but if you’d really like to know you just have to try your two different code examples and see if there’s a difference. There are a lot of factors involved (your system, your browser, the function you’re calling, etc) so a test is the way to go. I’d suggest Firebug for profiling.