Browse Source

kernel: remove recursion in context init.

Herbert Vojčík 7 years ago
parent
commit
94d878880a
1 changed files with 5 additions and 5 deletions
  1. 5 5
      support/kernel-runtime.js

+ 5 - 5
support/kernel-runtime.js

@@ -285,12 +285,12 @@ define(function () {
             this.index = index || 0;
         });
         defineMethod(SmalltalkMethodContext, "init", function () {
-            var home = this.homeContext;
-            if (home) {
-                home.init();
+            var frame = this;
+            while (frame) {
+                if (frame.init !== this.init) return frame.init();
+                frame.setup(frame);
+                frame = frame.homeContext;
             }
-
-            this.setup(this);
         });
         defineMethod(SmalltalkMethodContext, "method", function () {
             var method;