Up until now i assumed a call to AUI would be processed synchronously within the embedding JavaScript. Now I noticed the following behaviour:
Liferay.on('allPortletsReady',
function() {
AUI().use('node', function(A) {
// (1) --> set some global var here
});
// (2) --> use global var here
}
);
I expected the execution order (1) (2)
I got (2) (2) (2) (1) (1) (1)
I could live with the triple execution but I can't explain the reverse order.
The problem was easily solved by moving (2) inside the AUI sandbox, but I still wonder...