Browse Source

_st defined in directly in its module not in boot.js

Herbert Vojčík 10 years ago
parent
commit
91bdf4ab68
2 changed files with 16 additions and 26 deletions
  1. 15 12
      support/_st.js
  2. 1 14
      support/boot.js

+ 15 - 12
support/_st.js

@@ -1,15 +1,18 @@
 
-/* 
+/**
+ * _st is a function used all over the compiled amber code that
+ * takes any value (JavaScript or Smalltalk)
+ * and returns a proper Amber Smalltalk receiver.
+ *
+ * null or undefined -> nil,
+ * plain JS object -> wrapped JS object,
+ * otherwise unchanged
+ */
 
-_st points to a function used all over the compiled amber code that
-takes any value (JavaScript or Smalltalk) and returns a proper Amber Smalltalk receiver.
-
-null or undefined -> nil,
-plain JS object -> wrapped JS object,
-otherwise unchanged
-
-*/
-
-define("amber_vm/_st", ["./boot"], function (boot) {
-    return boot._st;
+define("amber_vm/_st", ["./smalltalk", "./nil"], function (smalltalk, nil) {
+    return function (o) {
+        if (o == null) { return nil; }
+        if (o.klass) { return o; }
+        return smalltalk.JSObjectProxy._on_(o);
+    };
 });

+ 1 - 14
support/boot.js

@@ -717,17 +717,6 @@ function SmalltalkInitBrik(brikz, st) {
 		st.alias(st.Array, "OrderedCollection");
 		st.alias(st.Date, "Time");
 
-		/*
-		 * Answer the smalltalk representation of o.
-		 * Used in message sends
-		 */
-
-		st._st = function (o) {
-			if(o == null) {return nil;}
-			if(o.klass) {return o;}
-			return st.JSObjectProxy._on_(o);
-		};
-
 	};
 }
 
@@ -1088,7 +1077,5 @@ function runnable () {
 	brikz.rebuild();
 };
 
-var result = { smalltalk: api, nil: brikz.root.nil, _st: api._st };
-api._st = null;
-return result;
+return { smalltalk: api, nil: brikz.root.nil };
 });