Commit be2d115f authored by Romain Courteaud's avatar Romain Courteaud

Remove not needed asynchronous function calls.

parent 201fdb09
...@@ -1076,9 +1076,6 @@ ...@@ -1076,9 +1076,6 @@
queue = new RSVP.Queue(); queue = new RSVP.Queue();
clearGadgetInternalParameters(gadget_instance); clearGadgetInternalParameters(gadget_instance);
// Trigger calling of all ready callback // Trigger calling of all ready callback
function ready_wrapper() {
return gadget_instance;
}
function ready_executable_wrapper(fct) { function ready_executable_wrapper(fct) {
return function executeReadyWrapper() { return function executeReadyWrapper() {
return fct.call(gadget_instance, gadget_instance); return fct.call(gadget_instance, gadget_instance);
...@@ -1090,8 +1087,6 @@ ...@@ -1090,8 +1087,6 @@
queue.push(ready_executable_wrapper( queue.push(ready_executable_wrapper(
gadget_instance.constructor.__ready_list[i] gadget_instance.constructor.__ready_list[i]
)); ));
// Always return the gadget instance after ready function
queue.push(ready_wrapper);
} }
// Store local reference to the gadget instance // Store local reference to the gadget instance
...@@ -1114,11 +1109,13 @@ ...@@ -1114,11 +1109,13 @@
options.sandbox); options.sandbox);
gadget_instance.element._gadget = gadget_instance; gadget_instance.element._gadget = gadget_instance;
function ready_wrapper() {
if (document.contains(gadget_instance.element)) { if (document.contains(gadget_instance.element)) {
// Put a timeout startService(gadget_instance);
queue.push(startService);
} }
// Always return the gadget instance after ready function // Always return the gadget instance after ready function
return gadget_instance;
}
queue.push(ready_wrapper); queue.push(ready_wrapper);
return queue; return queue;
...@@ -1721,25 +1718,19 @@ ...@@ -1721,25 +1718,19 @@
var i, var i,
ready_queue = new RSVP.Queue(); ready_queue = new RSVP.Queue();
function ready_wrapper() {
return root_gadget;
}
function ready_executable_wrapper(fct) { function ready_executable_wrapper(fct) {
return function wrapReadyFunction(g) { return function wrapReadyFunction() {
return fct.call(g, g); return fct.call(root_gadget, root_gadget);
}; };
} }
TmpConstructor.ready(function startServiceInReady() { TmpConstructor.ready(function startServiceInReady() {
return startService(this); return startService(root_gadget);
}); });
ready_queue.push(ready_wrapper);
for (i = 0; i < TmpConstructor.__ready_list.length; i += 1) { for (i = 0; i < TmpConstructor.__ready_list.length; i += 1) {
// Put a timeout? // Put a timeout?
ready_queue ready_queue
.push(ready_executable_wrapper(TmpConstructor.__ready_list[i])) .push(ready_executable_wrapper(TmpConstructor.__ready_list[i]));
// Always return the gadget instance after ready function
.push(ready_wrapper);
} }
return ready_queue; return ready_queue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment