Browse Source

Treat `Smalltalk postLoad` as possibly async.

Herby Vojčík 5 years ago
parent
commit
70a5de6a8b

+ 6 - 2
index.html

@@ -52,7 +52,9 @@
                         });
                     })
                     .then(function () {
-                        amber.globals.Smalltalk._postLoad();
+                        return amber.globals.Smalltalk._postLoad();
+                    })
+                    .then(function () {
                         a$cb$ = function (action) {
                             action(amber);
                         };
@@ -63,7 +65,9 @@
                         });
                     })
                     .then(function () {
-                        amber.globals.Smalltalk._postLoad();
+                        return amber.globals.Smalltalk._postLoad();
+                    })
+                    .then(function () {
                         messageBox.appendChild(done);
                     });
             });

+ 1 - 1
lang/base/kernel-runtime.js

@@ -463,7 +463,7 @@ define(function () {
         var globals = brikz.smalltalkGlobals.globals;
 
         this.run = function () {
-            globals.AmberBootstrapInitialization._run();
+            return globals.AmberBootstrapInitialization._run();
         };
     }
 

+ 2 - 3
lang/src/Kernel-Infrastructure.js

@@ -94,15 +94,14 @@ return $core.withContext(function($ctx1) {
 $recv($globals.SmalltalkImage)._initialize();
 $self._organizeClasses();
 $self._organizeMethods();
-$recv($globals.Smalltalk)._postLoad();
-return self;
+return $recv($globals.Smalltalk)._postLoad();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"run",{},$globals.AmberBootstrapInitialization.a$cls)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "run\x0a\x09SmalltalkImage initialize.\x0a\x09self\x0a\x09\x09organizeClasses;\x0a\x09\x09organizeMethods.\x0a\x09Smalltalk postLoad",
+source: "run\x0a\x09SmalltalkImage initialize.\x0a\x09self\x0a\x09\x09organizeClasses;\x0a\x09\x09organizeMethods.\x0a\x09^ Smalltalk postLoad",
 referencedClasses: ["SmalltalkImage", "Smalltalk"],
 //>>excludeEnd("ide");
 messageSends: ["initialize", "organizeClasses", "organizeMethods", "postLoad"]

+ 1 - 1
lang/src/Kernel-Infrastructure.st

@@ -22,7 +22,7 @@ run
 	self
 		organizeClasses;
 		organizeMethods.
-	Smalltalk postLoad
+	^ Smalltalk postLoad
 ! !
 
 ProtoObject subclass: #JSObjectProxy