Sfoglia il codice sorgente

kernel: remove recursion in context init.

Herbert Vojčík 7 anni fa
parent
commit
94d878880a
1 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  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;