浏览代码

removes getters and setters from AMDBrik

Nicolas Petton 11 年之前
父节点
当前提交
fe7b9eb980
共有 5 个文件被更改,包括 23 次插入47 次删除
  1. 6 6
      js/Kernel-Infrastructure.deploy.js
  2. 9 9
      js/Kernel-Infrastructure.js
  3. 3 3
      st/Kernel-Infrastructure.st
  4. 3 27
      support/boot.js
  5. 2 2
      support/smalltalk.js

+ 6 - 6
js/Kernel-Infrastructure.deploy.js

@@ -1396,10 +1396,10 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self._basicAt_("getAMDRequire"))._value();
+$1=self._basicAt_("amdRequire");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"amdRequire",{},smalltalk.Smalltalk)})},
-messageSends: ["value", "basicAt:"]}),
+messageSends: ["basicAt:"]}),
 smalltalk.Smalltalk);
 
 smalltalk.addMethod(
@@ -1507,10 +1507,10 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self._basicAt_("getDefaultAMDNamespace"))._value();
+$1=self._basicAt_("defaultAMDNamespace");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"defaultAMDNamespace",{},smalltalk.Smalltalk)})},
-messageSends: ["value", "basicAt:"]}),
+messageSends: ["basicAt:"]}),
 smalltalk.Smalltalk);
 
 smalltalk.addMethod(
@@ -1519,9 +1519,9 @@ selector: "defaultAMDNamespace:",
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(self._basicAt_("getDefaultAMDNamespace"))._value_(aString);
+self._basicAt_put_("defaultAMDNamespace",aString);
 return self}, function($ctx1) {$ctx1.fill(self,"defaultAMDNamespace:",{aString:aString},smalltalk.Smalltalk)})},
-messageSends: ["value:", "basicAt:"]}),
+messageSends: ["basicAt:put:"]}),
 smalltalk.Smalltalk);
 
 smalltalk.addMethod(

+ 9 - 9
js/Kernel-Infrastructure.js

@@ -1848,12 +1848,12 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self._basicAt_("getAMDRequire"))._value();
+$1=self._basicAt_("amdRequire");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"amdRequire",{},smalltalk.Smalltalk)})},
 args: [],
-source: "amdRequire\x0a\x09^ (self basicAt: 'getAMDRequire') value",
-messageSends: ["value", "basicAt:"],
+source: "amdRequire\x0a\x09^ self basicAt: 'amdRequire'",
+messageSends: ["basicAt:"],
 referencedClasses: []
 }),
 smalltalk.Smalltalk);
@@ -1999,12 +1999,12 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self._basicAt_("getDefaultAMDNamespace"))._value();
+$1=self._basicAt_("defaultAMDNamespace");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"defaultAMDNamespace",{},smalltalk.Smalltalk)})},
 args: [],
-source: "defaultAMDNamespace\x0a\x09^ (self basicAt: 'getDefaultAMDNamespace') value",
-messageSends: ["value", "basicAt:"],
+source: "defaultAMDNamespace\x0a\x09^ self basicAt: 'defaultAMDNamespace'",
+messageSends: ["basicAt:"],
 referencedClasses: []
 }),
 smalltalk.Smalltalk);
@@ -2016,11 +2016,11 @@ category: 'accessing amd',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(self._basicAt_("getDefaultAMDNamespace"))._value_(aString);
+self._basicAt_put_("defaultAMDNamespace",aString);
 return self}, function($ctx1) {$ctx1.fill(self,"defaultAMDNamespace:",{aString:aString},smalltalk.Smalltalk)})},
 args: ["aString"],
-source: "defaultAMDNamespace: aString\x0a\x09(self basicAt: 'getDefaultAMDNamespace') value: aString",
-messageSends: ["value:", "basicAt:"],
+source: "defaultAMDNamespace: aString\x0a\x09self basicAt: 'defaultAMDNamespace' put: aString",
+messageSends: ["basicAt:put:"],
 referencedClasses: []
 }),
 smalltalk.Smalltalk);

+ 3 - 3
st/Kernel-Infrastructure.st

@@ -783,15 +783,15 @@ version
 !Smalltalk methodsFor: 'accessing amd'!
 
 amdRequire
-	^ (self basicAt: 'getAMDRequire') value
+	^ self basicAt: 'amdRequire'
 !
 
 defaultAMDNamespace
-	^ (self basicAt: 'getDefaultAMDNamespace') value
+	^ self basicAt: 'defaultAMDNamespace'
 !
 
 defaultAMDNamespace: aString
-	(self basicAt: 'getDefaultAMDNamespace') value: aString
+	self basicAt: 'defaultAMDNamespace' put: aString
 ! !
 
 !Smalltalk methodsFor: 'classes'!

+ 3 - 27
support/boot.js

@@ -1054,33 +1054,9 @@ function SelectorConversionBrik(brikz, st) {
 
 /* Adds AMD and requirejs related methods to the smalltalk object */
 function AMDBrik(brikz, st) {
-	var amdRequire;
-	var defaultTransportType = "amd";
-	var defaultAMDNamespace = "amber";
-
-	st.setAMDRequire = function(req) {
-		amdRequire = req;
-	};
-
-	st.getAMDRequire = function() {
-		return amdRequire;
-	};
-
-	st.setDefaultTransportType = function(type) {
-		defaultTransportType = type;
-	};
-
-	st.getDefaultTransportType = function() {
-		return defaultTransportType;
-	};
-
-	st.setDefaultAMDNamespace = function(name) {
-		defaultAMDNamespace = name;
-	};
-
-	st.getDefaultAMDNamespace = function() {
-		return defaultAMDNamespace;
-	};
+	st.amdRequire = null;
+	st.defaultTransportType = "amd";
+	st.defaultAMDNamespace = "amber";
 }
 
 

+ 2 - 2
support/smalltalk.js

@@ -1,9 +1,9 @@
 define("amber_vm/smalltalk", ["require", "module", "./boot"], function (require, module, boot) {
     var smalltalk = boot.smalltalk;
-	smalltalk.setAMDRequire(require);
+	smalltalk.amdRequire = require;
     var config = module.config && module.config();
     if (config) {
-		smalltalk.setDefaultAMDNamespace(config.defaultNamespace);
+		smalltalk.defaultAMDNamespace = config.defaultNamespace;
     }
     return  smalltalk;
 });