Browse Source

AmberBootstrapInitialization.

Class initialization moved to Smalltalk side.
Herbert Vojčík 5 months 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 @@
3 3
 * Deprecate amber/boot api nextId.
4 4
 * Deprecate ProtoObject >> identityHash.
5 5
 
6
++ AmberBootstrapInitialization class >>
7
+  + run
8
+  + initializeClasses
6 9
 + UndefinedObject >>
7 10
   + ==
8 11
 

+ 8 - 0
CHANGELOG

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

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


+ 18 - 0
src/Kernel-Infrastructure.st

@@ -1,4 +1,22 @@
1 1
 Smalltalk createPackage: 'Kernel-Infrastructure'!
2
+Object subclass: #AmberBootstrapInitialization
3
+	instanceVariableNames: ''
4
+	package: 'Kernel-Infrastructure'!
5
+
6
+!AmberBootstrapInitialization class methodsFor: 'initialization'!
7
+
8
+initializeClasses
9
+	SmalltalkImage initialize.
10
+	Smalltalk classes do: [ :each |
11
+		each = SmalltalkImage ifFalse: [ each initialize ] ]
12
+! !
13
+
14
+!AmberBootstrapInitialization class methodsFor: 'public api'!
15
+
16
+run
17
+	self initializeClasses
18
+! !
19
+
2 20
 ProtoObject subclass: #JSObjectProxy
3 21
 	instanceVariableNames: 'jsObject'
4 22
 	package: 'Kernel-Infrastructure'!

+ 1 - 4
support/kernel-runtime.js

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