1
0
Quellcode durchsuchen

kernel: fill{,Block} w/ more fallbacks

Herbert Vojčík vor 7 Jahren
Ursprung
Commit
f91e737bd9
1 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen
  1. 6 4
      support/kernel-runtime.js

+ 6 - 4
support/kernel-runtime.js

@@ -268,24 +268,26 @@ define(function () {
         }
 
         // Fallbacks
-        SmalltalkMethodContext.prototype.locals = {};
+        SmalltalkMethodContext.prototype.locals = Object.freeze({});
         SmalltalkMethodContext.prototype.receiver = null;
         SmalltalkMethodContext.prototype.selector = null;
         SmalltalkMethodContext.prototype.lookupClass = null;
+        SmalltalkMethodContext.prototype.outerContext = null;
+        SmalltalkMethodContext.prototype.index = 0;
 
         defineMethod(SmalltalkMethodContext, "fill", function (receiver, selector, locals, lookupClass) {
             this.receiver = receiver;
             this.selector = selector;
-            this.locals = locals || {};
+            if (locals != null) this.locals = locals;
             this.lookupClass = lookupClass;
             if (this.homeContext) {
                 this.homeContext.evaluatedSelector = selector;
             }
         });
         defineMethod(SmalltalkMethodContext, "fillBlock", function (locals, ctx, index) {
-            this.locals = locals || {};
+            if (locals != null) this.locals = locals;
             this.outerContext = ctx;
-            this.index = index || 0;
+            if (index) this.index = index;
         });
         defineMethod(SmalltalkMethodContext, "init", function () {
             var frame = this;