Worked around initConnection() failures due to machines that initialize more slowly, by also allowing each machine to invoke the other's initConnection(); if it turns out to be unnecessary, it's simply ignored

This commit is contained in:
Jeff Parsons 2016-08-19 12:35:18 -07:00
commit 983651610c
14 changed files with 1035 additions and 937 deletions

View file

@ -226,17 +226,9 @@ Component.subclass = function(subclass, superclass, methods, statics)
* various resources used by that machine.
*/
if (window) {
if (!window['PCjs']) {
window['PCjs'] = {
'Machines': {},
'Components': []
};
}
/*
* Alias the new global objects above to their original property names, to minimize code changes.
*/
Component.machines = window['PCjs']['Machines'];
Component.components = window['PCjs']['Components'];
if (!window['PCjs']) window['PCjs'] = {};
Component.machines = window['PCjs']['Machines'] || (window['PCjs']['Machines'] = {});
Component.components = window['PCjs']['Components'] || (window['PCjs']['Components'] = []);
}
else {
/*