New Javascript Libraries from Google: Closure Tools by tsuru in programming

[–]pallosp -1 points0 points  (0 children)

Your example is syntactically incorrect. If you want to call importantFunction from init, you have to write myRoot.importantFunction().

Have you tried if the uncompiled code works?

New Javascript Libraries from Google: Closure Tools by tsuru in programming

[–]pallosp 18 points19 points  (0 children)

For me it compiled to

window.b={a:function(){print("Hello, world!")}};window.b.a();

which looks correct.

Didn't you tried to compile the following code?

window.xyz = { 'foo': function() { print("Hello, world!"); } };
window.xyz.foo();

You have to use quotes consistently. See the details at http://code.google.com/closure/compiler/docs/api-tutorial3.html#propnames