Преглед изворни кода

global_* named variables not used at all

Herbert Vojčík пре 11 година
родитељ
комит
6bfcf9e1fe
3 измењених фајлова са 7 додато и 10 уклоњено
  1. 1 1
      bin/amberc.js
  2. 4 7
      js/boot.js
  3. 2 2
      test/Test.js

+ 1 - 1
bin/amberc.js

@@ -418,7 +418,7 @@ AmberC.prototype.create_compiler = function(compilerFilesArray) {
 			// data is an array where index 0 is the error code and index 1 contains the data
 			content += data[1];
 		});
-		content = content + 'return global_smalltalk;})();';
+		content = content + 'return smalltalk;})();';
 		self.defaults.smalltalk = eval(content);
 		console.log('Compiler loaded');
 		self.defaults.smalltalk.ErrorHandler._setCurrent_(self.defaults.smalltalk.RethrowErrorHandler._new());

+ 4 - 7
js/boot.js

@@ -36,9 +36,6 @@
 
 define([ 'ensure-console', 'es5-shim-2.0.2/es5-shim.min', 'es5-shim-2.0.2/es5-sham.min' ], function () {
 
-/* Previouslu global Smalltalk objects; now they are local to this module and exported. */
-var global_smalltalk, global_nil, global__st;
-
 /* Array extensions */
 
 Array.prototype.addElement = function(el) {
@@ -95,7 +92,7 @@ inherits(SmalltalkPackageOrganizer, SmalltalkOrganizer);
 inherits(SmalltalkClassOrganizer, SmalltalkOrganizer);
 
 
-var nil = global_nil = new SmalltalkNil();
+var nil = new SmalltalkNil();
 
 function Smalltalk() {
 
@@ -799,7 +796,7 @@ SmalltalkMethodContext.prototype.lookupClass = null;
 
 inherits(SmalltalkMethodContext, SmalltalkObject);
 
-var smalltalk = global_smalltalk = new Smalltalk();
+var smalltalk = new Smalltalk();
 
 SmalltalkMethodContext.prototype.fill = function(receiver, selector, locals, lookupClass) {
 	this.receiver    = receiver;
@@ -837,7 +834,7 @@ SmalltalkMethodContext.prototype.method = function() {
  * Used in message sends
  */
 
-global__st = function(o) {
+function _st(o) {
 	if(o == null) {return nil;}
 	if(o.klass) {return o;}
 	return smalltalk.JSObjectProxy._on_(o);
@@ -884,5 +881,5 @@ smalltalk.wrapClassName("MethodContext", "Kernel-Methods", SmalltalkMethodContex
 smalltalk.alias(smalltalk.Array, "OrderedCollection");
 smalltalk.alias(smalltalk.Date, "Time");
 
-return { smalltalk: global_smalltalk, nil: global_nil, _st: global__st };
+return { smalltalk: smalltalk, nil: nil, _st: _st };
 });

+ 2 - 2
test/Test.js

@@ -1,4 +1,4 @@
-(function(smalltalk,nil,_st){
+define(["smalltalk","nil","_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Test');
 smalltalk.addClass('NodeTestRunner', smalltalk.Object, [], 'Test');
 
@@ -68,4 +68,4 @@ referencedClasses: ["OrderedCollection", "TestCase", "TestSuiteRunner", "ResultA
 smalltalk.NodeTestRunner.klass);
 
 
-})(global_smalltalk,global_nil,global__st);
+});