Browse Source

AmberBootstrapInitialization.

Class initialization moved to Smalltalk side.
Herbert Vojčík 1 year ago
parent
commit
c4c876f84a
5 changed files with 97 additions and 4 deletions
  1. 3 0
      API-CHANGES.txt
  2. 8 0
      CHANGELOG
  3. 67 0
      src/Kernel-Infrastructure.js
  4. 18 0
      src/Kernel-Infrastructure.st
  5. 1 4
      support/kernel-runtime.js

+ 3 - 0
API-CHANGES.txt

@@ -3,6 +3,9 @@
 * Deprecate amber/boot api nextId.
 * Deprecate ProtoObject >> identityHash.
 
++ AmberBootstrapInitialization class >>
+  + run
+  + initializeClasses
 + UndefinedObject >>
   + ==
 

+ 8 - 0
CHANGELOG

@@ -1,3 +1,11 @@
+?? May 2017 - Release 0.19.1
+===================================
+
+* Kernel slimmed, things moved to Smalltalk side.
+
+Commits: https://lolg.it/amber/amber/commits/0.19.1.
+
+
 20 April 2017 - Release 0.19.0
 ===================================
 

File diff suppressed because it is too large
+ 67 - 0
src/Kernel-Infrastructure.js


+ 18 - 0
src/Kernel-Infrastructure.st

@@ -1,4 +1,22 @@
 Smalltalk createPackage: 'Kernel-Infrastructure'!
+Object subclass: #AmberBootstrapInitialization
+	instanceVariableNames: ''
+	package: 'Kernel-Infrastructure'!
+
+!AmberBootstrapInitialization class methodsFor: 'initialization'!
+
+initializeClasses
+	SmalltalkImage initialize.
+	Smalltalk classes do: [ :each |
+		each = SmalltalkImage ifFalse: [ each initialize ] ]
+! !
+
+!AmberBootstrapInitialization class methodsFor: 'public api'!
+
+run
+	self initializeClasses
+! !
+
 ProtoObject subclass: #JSObjectProxy
 	instanceVariableNames: 'jsObject'
 	package: 'Kernel-Infrastructure'!

+ 1 - 4
support/kernel-runtime.js

@@ -468,10 +468,7 @@ define(function () {
     StartImageBrik.deps = ["frameBinding", "runtimeMethods", "runtime", "primitives"];
     function StartImageBrik (brikz, st) {
         this.__init__ = function () {
-            var classes = brikz.behaviors.classes;
-            classes().forEach(function (klass) {
-                klass._initialize();
-            });
+            brikz.smalltalkGlobals.globals.AmberBootstrapInitialization._run();
         };
         this.__init__.once = true;
     }