فهرست منبع

boot.js: globals localized in boot.js

Herbert Vojčík 11 سال پیش
والد
کامیت
c85d2a46d4
1فایلهای تغییر یافته به همراه18 افزوده شده و 11 حذف شده
  1. 18 11
      js/boot.js

+ 18 - 11
js/boot.js

@@ -101,6 +101,12 @@ inherits(SmalltalkPackageOrganizer, SmalltalkOrganizer);
 inherits(SmalltalkClassOrganizer, SmalltalkOrganizer);
 inherits(SmalltalkClassOrganizer, SmalltalkOrganizer);
 
 
 
 
+/* Global Smalltalk objects. */
+var smalltalk, nil, _st;
+
+nil = new SmalltalkNil();
+(function (nil) {
+
 function Smalltalk() {
 function Smalltalk() {
 
 
 	var st = this;
 	var st = this;
@@ -196,7 +202,7 @@ function Smalltalk() {
 	}
 	}
 
 
 	/* Smalltalk class creation. A class is an instance of an automatically
 	/* Smalltalk class creation. A class is an instance of an automatically
-		created metaclass object. Newly created classes (not their metaclass) 
+		created metaclass object. Newly created classes (not their metaclass)
 		should be added to the smalltalk object, see smalltalk.addClass().
 		should be added to the smalltalk object, see smalltalk.addClass().
 		Superclass linking is *not* handled here, see smalltalk.init()  */
 		Superclass linking is *not* handled here, see smalltalk.init()  */
 
 
@@ -785,6 +791,10 @@ function Smalltalk() {
 
 
 inherits(Smalltalk, SmalltalkObject);
 inherits(Smalltalk, SmalltalkObject);
 
 
+if(this.jQuery) {
+    this.jQuery.allowJavaScriptCalls = true;
+}
+
 function SmalltalkMethodContext(home, setup) {
 function SmalltalkMethodContext(home, setup) {
 	this.homeContext = home;
 	this.homeContext = home;
 	this.setup       = setup || function() {};
 	this.setup       = setup || function() {};
@@ -799,6 +809,9 @@ SmalltalkMethodContext.prototype.lookupClass = null;
 
 
 inherits(SmalltalkMethodContext, SmalltalkObject);
 inherits(SmalltalkMethodContext, SmalltalkObject);
 
 
+smalltalk = new Smalltalk();
+(function (smalltalk) {
+
 SmalltalkMethodContext.prototype.fill = function(receiver, selector, locals, lookupClass) {
 SmalltalkMethodContext.prototype.fill = function(receiver, selector, locals, lookupClass) {
 	this.receiver    = receiver;
 	this.receiver    = receiver;
 	this.selector    = selector;
 	this.selector    = selector;
@@ -830,21 +843,12 @@ SmalltalkMethodContext.prototype.method = function() {
 	return method;
 	return method;
 };
 };
 
 
-/* Global Smalltalk objects. */
-
-var nil = new SmalltalkNil();
-var smalltalk = new Smalltalk();
-
-if(this.jQuery) {
-	this.jQuery.allowJavaScriptCalls = true;
-}
-
 /*
 /*
  * Answer the smalltalk representation of o.
  * Answer the smalltalk representation of o.
  * Used in message sends
  * Used in message sends
  */
  */
 
 
-var _st = function(o) {
+_st = function(o) {
 	if(o == null) {return nil;}
 	if(o == null) {return nil;}
 	if(o.klass) {return o;}
 	if(o.klass) {return o;}
 	return smalltalk.JSObjectProxy._on_(o);
 	return smalltalk.JSObjectProxy._on_(o);
@@ -890,3 +894,6 @@ smalltalk.wrapClassName("MethodContext", "Kernel-Methods", SmalltalkMethodContex
 
 
 smalltalk.alias(smalltalk.Array, "OrderedCollection");
 smalltalk.alias(smalltalk.Array, "OrderedCollection");
 smalltalk.alias(smalltalk.Date, "Time");
 smalltalk.alias(smalltalk.Date, "Time");
+
+})(smalltalk);
+})(nil);