浏览代码

reverseTrapAt:[put:] -> Trapped-Backend

Herbert Vojčík 12 年之前
父节点
当前提交
c7abd85532
共有 6 个文件被更改,包括 304 次插入304 次删除
  1. 112 0
      js/Trapped-Backend.deploy.js
  2. 152 0
      js/Trapped-Backend.js
  3. 0 112
      js/Trapped-Common.deploy.js
  4. 0 152
      js/Trapped-Common.js
  5. 40 0
      st/Trapped-Backend.st
  6. 0 40
      st/Trapped-Common.st

+ 112 - 0
js/Trapped-Backend.deploy.js

@@ -129,6 +129,28 @@ return $1;
 smalltalk.Isolator.klass);
 
 
+smalltalk.addMethod(
+"_reverseTrapAt_",
+smalltalk.method({
+selector: "reverseTrapAt:",
+fn: function (anObject){
+var self=this;
+return nil;
+}
+}),
+smalltalk.Object);
+
+smalltalk.addMethod(
+"_reverseTrapAt_put_",
+smalltalk.method({
+selector: "reverseTrapAt:put:",
+fn: function (anObject,value){
+var self=this;
+smalltalk.send(self,"_error_",[smalltalk.send(smalltalk.send("Trapped cannot put at ","__comma",[smalltalk.send(smalltalk.send(self,"_class",[]),"_name",[])]),"__comma",[" type key."])]);
+return self}
+}),
+smalltalk.Object);
+
 smalltalk.addMethod(
 "_asEavModel",
 smalltalk.method({
@@ -167,3 +189,93 @@ return model;
 }),
 smalltalk.SequenceableCollection);
 
+smalltalk.addMethod(
+"_reverseTrapAt_",
+smalltalk.method({
+selector: "reverseTrapAt:",
+fn: function (anObject){
+var self=this;
+var $1;
+$1=smalltalk.send(anObject,"_at_ifAbsent_",[self,(function(){
+return nil;
+})]);
+return $1;
+}
+}),
+smalltalk.String);
+
+smalltalk.addMethod(
+"_reverseTrapAt_put_",
+smalltalk.method({
+selector: "reverseTrapAt:put:",
+fn: function (anObject,value){
+var self=this;
+var $1;
+$1=smalltalk.send(anObject,"_at_put_",[self,value]);
+return $1;
+}
+}),
+smalltalk.String);
+
+smalltalk.addMethod(
+"_reverseTrapAt_",
+smalltalk.method({
+selector: "reverseTrapAt:",
+fn: function (anObject){
+var self=this;
+var $1;
+var $early={};
+try {
+$1=smalltalk.send((function(){
+return smalltalk.send(anObject,"_perform_",[self]);
+}),"_on_do_",[(smalltalk.MessageNotUnderstood || MessageNotUnderstood),(function(){
+throw $early=[nil];
+})]);
+return $1;
+}
+catch(e) {if(e===$early)return e[0]; throw e}
+}
+}),
+smalltalk.Symbol);
+
+smalltalk.addMethod(
+"_reverseTrapAt_put_",
+smalltalk.method({
+selector: "reverseTrapAt:put:",
+fn: function (anObject,value){
+var self=this;
+var $1;
+$1=smalltalk.send(anObject,"_perform_withArguments_",[smalltalk.send(smalltalk.send(self,"__comma",[":"]),"_asSymbol",[]),[value]]);
+return $1;
+}
+}),
+smalltalk.Symbol);
+
+smalltalk.addMethod(
+"_reverseTrapAt_",
+smalltalk.method({
+selector: "reverseTrapAt:",
+fn: function (anObject){
+var self=this;
+var $1;
+$1=smalltalk.send(anObject,"_at_ifAbsent_",[self,(function(){
+return nil;
+})]);
+return $1;
+}
+}),
+smalltalk.Number);
+
+smalltalk.addMethod(
+"_reverseTrapAt_put_",
+smalltalk.method({
+selector: "reverseTrapAt:put:",
+fn: function (anObject,value){
+var self=this;
+var $1;
+$1=smalltalk.send(anObject,"_at_put_",[self,value]);
+return $1;
+}
+}),
+smalltalk.Number);
+

+ 152 - 0
js/Trapped-Backend.js

@@ -180,6 +180,38 @@ referencedClasses: []
 smalltalk.Isolator.klass);
 
 
+smalltalk.addMethod(
+"_reverseTrapAt_",
+smalltalk.method({
+selector: "reverseTrapAt:",
+category: '*Trapped-Backend',
+fn: function (anObject){
+var self=this;
+return nil;
+},
+args: ["anObject"],
+source: "reverseTrapAt: anObject\x0a\x09^nil",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Object);
+
+smalltalk.addMethod(
+"_reverseTrapAt_put_",
+smalltalk.method({
+selector: "reverseTrapAt:put:",
+category: '*Trapped-Backend',
+fn: function (anObject,value){
+var self=this;
+smalltalk.send(self,"_error_",[smalltalk.send(smalltalk.send("Trapped cannot put at ","__comma",[smalltalk.send(smalltalk.send(self,"_class",[]),"_name",[])]),"__comma",[" type key."])]);
+return self},
+args: ["anObject", "value"],
+source: "reverseTrapAt: anObject put: value\x0a\x09self error: 'Trapped cannot put at ', self class name, ' type key.'",
+messageSends: ["error:", ",", "name", "class"],
+referencedClasses: []
+}),
+smalltalk.Object);
+
 smalltalk.addMethod(
 "_asEavModel",
 smalltalk.method({
@@ -223,3 +255,123 @@ referencedClasses: ["EavModel"]
 }),
 smalltalk.SequenceableCollection);
 
+smalltalk.addMethod(
+"_reverseTrapAt_",
+smalltalk.method({
+selector: "reverseTrapAt:",
+category: '*Trapped-Backend',
+fn: function (anObject){
+var self=this;
+var $1;
+$1=smalltalk.send(anObject,"_at_ifAbsent_",[self,(function(){
+return nil;
+})]);
+return $1;
+},
+args: ["anObject"],
+source: "reverseTrapAt: anObject\x0a\x09^anObject at: self ifAbsent: [nil]",
+messageSends: ["at:ifAbsent:"],
+referencedClasses: []
+}),
+smalltalk.String);
+
+smalltalk.addMethod(
+"_reverseTrapAt_put_",
+smalltalk.method({
+selector: "reverseTrapAt:put:",
+category: '*Trapped-Backend',
+fn: function (anObject,value){
+var self=this;
+var $1;
+$1=smalltalk.send(anObject,"_at_put_",[self,value]);
+return $1;
+},
+args: ["anObject", "value"],
+source: "reverseTrapAt: anObject put: value\x0a\x09^anObject at: self put: value",
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.String);
+
+smalltalk.addMethod(
+"_reverseTrapAt_",
+smalltalk.method({
+selector: "reverseTrapAt:",
+category: '*Trapped-Backend',
+fn: function (anObject){
+var self=this;
+var $1;
+var $early={};
+try {
+$1=smalltalk.send((function(){
+return smalltalk.send(anObject,"_perform_",[self]);
+}),"_on_do_",[(smalltalk.MessageNotUnderstood || MessageNotUnderstood),(function(){
+throw $early=[nil];
+})]);
+return $1;
+}
+catch(e) {if(e===$early)return e[0]; throw e}
+},
+args: ["anObject"],
+source: "reverseTrapAt: anObject\x0a\x09^[anObject perform: self] on: MessageNotUnderstood do: [^nil]",
+messageSends: ["on:do:", "perform:"],
+referencedClasses: ["MessageNotUnderstood"]
+}),
+smalltalk.Symbol);
+
+smalltalk.addMethod(
+"_reverseTrapAt_put_",
+smalltalk.method({
+selector: "reverseTrapAt:put:",
+category: '*Trapped-Backend',
+fn: function (anObject,value){
+var self=this;
+var $1;
+$1=smalltalk.send(anObject,"_perform_withArguments_",[smalltalk.send(smalltalk.send(self,"__comma",[":"]),"_asSymbol",[]),[value]]);
+return $1;
+},
+args: ["anObject", "value"],
+source: "reverseTrapAt: anObject put: value\x0a    ^anObject perform: (self, ':') asSymbol withArguments: { value }",
+messageSends: ["perform:withArguments:", "asSymbol", ","],
+referencedClasses: []
+}),
+smalltalk.Symbol);
+
+smalltalk.addMethod(
+"_reverseTrapAt_",
+smalltalk.method({
+selector: "reverseTrapAt:",
+category: '*Trapped-Backend',
+fn: function (anObject){
+var self=this;
+var $1;
+$1=smalltalk.send(anObject,"_at_ifAbsent_",[self,(function(){
+return nil;
+})]);
+return $1;
+},
+args: ["anObject"],
+source: "reverseTrapAt: anObject\x0a\x09^anObject at: self ifAbsent: [nil]",
+messageSends: ["at:ifAbsent:"],
+referencedClasses: []
+}),
+smalltalk.Number);
+
+smalltalk.addMethod(
+"_reverseTrapAt_put_",
+smalltalk.method({
+selector: "reverseTrapAt:put:",
+category: '*Trapped-Backend',
+fn: function (anObject,value){
+var self=this;
+var $1;
+$1=smalltalk.send(anObject,"_at_put_",[self,value]);
+return $1;
+},
+args: ["anObject", "value"],
+source: "reverseTrapAt: anObject put: value\x0a\x09^anObject at: self put: value",
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.Number);
+

+ 0 - 112
js/Trapped-Common.deploy.js

@@ -162,115 +162,3 @@ return self}
 smalltalk.TrappedModelWrapper.klass);
 
 
-smalltalk.addMethod(
-"_reverseTrapAt_",
-smalltalk.method({
-selector: "reverseTrapAt:",
-fn: function (anObject){
-var self=this;
-return nil;
-}
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-"_reverseTrapAt_put_",
-smalltalk.method({
-selector: "reverseTrapAt:put:",
-fn: function (anObject,value){
-var self=this;
-smalltalk.send(self,"_error_",[smalltalk.send(smalltalk.send("Trapped cannot put at ","__comma",[smalltalk.send(smalltalk.send(self,"_class",[]),"_name",[])]),"__comma",[" type key."])]);
-return self}
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-"_reverseTrapAt_",
-smalltalk.method({
-selector: "reverseTrapAt:",
-fn: function (anObject){
-var self=this;
-var $1;
-$1=smalltalk.send(anObject,"_at_ifAbsent_",[self,(function(){
-return nil;
-})]);
-return $1;
-}
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-"_reverseTrapAt_put_",
-smalltalk.method({
-selector: "reverseTrapAt:put:",
-fn: function (anObject,value){
-var self=this;
-var $1;
-$1=smalltalk.send(anObject,"_at_put_",[self,value]);
-return $1;
-}
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-"_reverseTrapAt_",
-smalltalk.method({
-selector: "reverseTrapAt:",
-fn: function (anObject){
-var self=this;
-var $1;
-var $early={};
-try {
-$1=smalltalk.send((function(){
-return smalltalk.send(anObject,"_perform_",[self]);
-}),"_on_do_",[(smalltalk.MessageNotUnderstood || MessageNotUnderstood),(function(){
-throw $early=[nil];
-})]);
-return $1;
-}
-catch(e) {if(e===$early)return e[0]; throw e}
-}
-}),
-smalltalk.Symbol);
-
-smalltalk.addMethod(
-"_reverseTrapAt_put_",
-smalltalk.method({
-selector: "reverseTrapAt:put:",
-fn: function (anObject,value){
-var self=this;
-var $1;
-$1=smalltalk.send(anObject,"_perform_withArguments_",[smalltalk.send(smalltalk.send(self,"__comma",[":"]),"_asSymbol",[]),[value]]);
-return $1;
-}
-}),
-smalltalk.Symbol);
-
-smalltalk.addMethod(
-"_reverseTrapAt_",
-smalltalk.method({
-selector: "reverseTrapAt:",
-fn: function (anObject){
-var self=this;
-var $1;
-$1=smalltalk.send(anObject,"_at_ifAbsent_",[self,(function(){
-return nil;
-})]);
-return $1;
-}
-}),
-smalltalk.Number);
-
-smalltalk.addMethod(
-"_reverseTrapAt_put_",
-smalltalk.method({
-selector: "reverseTrapAt:put:",
-fn: function (anObject,value){
-var self=this;
-var $1;
-$1=smalltalk.send(anObject,"_at_put_",[self,value]);
-return $1;
-}
-}),
-smalltalk.Number);
-

+ 0 - 152
js/Trapped-Common.js

@@ -219,155 +219,3 @@ referencedClasses: []
 smalltalk.TrappedModelWrapper.klass);
 
 
-smalltalk.addMethod(
-"_reverseTrapAt_",
-smalltalk.method({
-selector: "reverseTrapAt:",
-category: '*Trapped-Common',
-fn: function (anObject){
-var self=this;
-return nil;
-},
-args: ["anObject"],
-source: "reverseTrapAt: anObject\x0a\x09^nil",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-"_reverseTrapAt_put_",
-smalltalk.method({
-selector: "reverseTrapAt:put:",
-category: '*Trapped-Common',
-fn: function (anObject,value){
-var self=this;
-smalltalk.send(self,"_error_",[smalltalk.send(smalltalk.send("Trapped cannot put at ","__comma",[smalltalk.send(smalltalk.send(self,"_class",[]),"_name",[])]),"__comma",[" type key."])]);
-return self},
-args: ["anObject", "value"],
-source: "reverseTrapAt: anObject put: value\x0a\x09self error: 'Trapped cannot put at ', self class name, ' type key.'",
-messageSends: ["error:", ",", "name", "class"],
-referencedClasses: []
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-"_reverseTrapAt_",
-smalltalk.method({
-selector: "reverseTrapAt:",
-category: '*Trapped-Common',
-fn: function (anObject){
-var self=this;
-var $1;
-$1=smalltalk.send(anObject,"_at_ifAbsent_",[self,(function(){
-return nil;
-})]);
-return $1;
-},
-args: ["anObject"],
-source: "reverseTrapAt: anObject\x0a\x09^anObject at: self ifAbsent: [nil]",
-messageSends: ["at:ifAbsent:"],
-referencedClasses: []
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-"_reverseTrapAt_put_",
-smalltalk.method({
-selector: "reverseTrapAt:put:",
-category: '*Trapped-Common',
-fn: function (anObject,value){
-var self=this;
-var $1;
-$1=smalltalk.send(anObject,"_at_put_",[self,value]);
-return $1;
-},
-args: ["anObject", "value"],
-source: "reverseTrapAt: anObject put: value\x0a\x09^anObject at: self put: value",
-messageSends: ["at:put:"],
-referencedClasses: []
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-"_reverseTrapAt_",
-smalltalk.method({
-selector: "reverseTrapAt:",
-category: '*Trapped-Common',
-fn: function (anObject){
-var self=this;
-var $1;
-var $early={};
-try {
-$1=smalltalk.send((function(){
-return smalltalk.send(anObject,"_perform_",[self]);
-}),"_on_do_",[(smalltalk.MessageNotUnderstood || MessageNotUnderstood),(function(){
-throw $early=[nil];
-})]);
-return $1;
-}
-catch(e) {if(e===$early)return e[0]; throw e}
-},
-args: ["anObject"],
-source: "reverseTrapAt: anObject\x0a\x09^[anObject perform: self] on: MessageNotUnderstood do: [^nil]",
-messageSends: ["on:do:", "perform:"],
-referencedClasses: ["MessageNotUnderstood"]
-}),
-smalltalk.Symbol);
-
-smalltalk.addMethod(
-"_reverseTrapAt_put_",
-smalltalk.method({
-selector: "reverseTrapAt:put:",
-category: '*Trapped-Common',
-fn: function (anObject,value){
-var self=this;
-var $1;
-$1=smalltalk.send(anObject,"_perform_withArguments_",[smalltalk.send(smalltalk.send(self,"__comma",[":"]),"_asSymbol",[]),[value]]);
-return $1;
-},
-args: ["anObject", "value"],
-source: "reverseTrapAt: anObject put: value\x0a    ^anObject perform: (self, ':') asSymbol withArguments: { value }",
-messageSends: ["perform:withArguments:", "asSymbol", ","],
-referencedClasses: []
-}),
-smalltalk.Symbol);
-
-smalltalk.addMethod(
-"_reverseTrapAt_",
-smalltalk.method({
-selector: "reverseTrapAt:",
-category: '*Trapped-Common',
-fn: function (anObject){
-var self=this;
-var $1;
-$1=smalltalk.send(anObject,"_at_ifAbsent_",[self,(function(){
-return nil;
-})]);
-return $1;
-},
-args: ["anObject"],
-source: "reverseTrapAt: anObject\x0a\x09^anObject at: self ifAbsent: [nil]",
-messageSends: ["at:ifAbsent:"],
-referencedClasses: []
-}),
-smalltalk.Number);
-
-smalltalk.addMethod(
-"_reverseTrapAt_put_",
-smalltalk.method({
-selector: "reverseTrapAt:put:",
-category: '*Trapped-Common',
-fn: function (anObject,value){
-var self=this;
-var $1;
-$1=smalltalk.send(anObject,"_at_put_",[self,value]);
-return $1;
-},
-args: ["anObject", "value"],
-source: "reverseTrapAt: anObject put: value\x0a\x09^anObject at: self put: value",
-messageSends: ["at:put:"],
-referencedClasses: []
-}),
-smalltalk.Number);
-

+ 40 - 0
st/Trapped-Backend.st

@@ -73,6 +73,16 @@ on: anObject
 ^self new root: anObject
 ! !
 
+!Object methodsFor: '*Trapped-Backend'!
+
+reverseTrapAt: anObject
+	^nil
+!
+
+reverseTrapAt: anObject put: value
+	self error: 'Trapped cannot put at ', self class name, ' type key.'
+! !
+
 !SequenceableCollection methodsFor: '*Trapped-Backend'!
 
 asEavModel
@@ -89,3 +99,33 @@ asEavModel
     ^model
 ! !
 
+!String methodsFor: '*Trapped-Backend'!
+
+reverseTrapAt: anObject
+	^anObject at: self ifAbsent: [nil]
+!
+
+reverseTrapAt: anObject put: value
+	^anObject at: self put: value
+! !
+
+!Symbol methodsFor: '*Trapped-Backend'!
+
+reverseTrapAt: anObject
+	^[anObject perform: self] on: MessageNotUnderstood do: [^nil]
+!
+
+reverseTrapAt: anObject put: value
+    ^anObject perform: (self, ':') asSymbol withArguments: { value }
+! !
+
+!Number methodsFor: '*Trapped-Backend'!
+
+reverseTrapAt: anObject
+	^anObject at: self ifAbsent: [nil]
+!
+
+reverseTrapAt: anObject put: value
+	^anObject at: self put: value
+! !
+

+ 0 - 40
st/Trapped-Common.st

@@ -95,43 +95,3 @@ start
 	self new start
 ! !
 
-!Object methodsFor: '*Trapped-Common'!
-
-reverseTrapAt: anObject
-	^nil
-!
-
-reverseTrapAt: anObject put: value
-	self error: 'Trapped cannot put at ', self class name, ' type key.'
-! !
-
-!String methodsFor: '*Trapped-Common'!
-
-reverseTrapAt: anObject
-	^anObject at: self ifAbsent: [nil]
-!
-
-reverseTrapAt: anObject put: value
-	^anObject at: self put: value
-! !
-
-!Symbol methodsFor: '*Trapped-Common'!
-
-reverseTrapAt: anObject
-	^[anObject perform: self] on: MessageNotUnderstood do: [^nil]
-!
-
-reverseTrapAt: anObject put: value
-    ^anObject perform: (self, ':') asSymbol withArguments: { value }
-! !
-
-!Number methodsFor: '*Trapped-Common'!
-
-reverseTrapAt: anObject
-	^anObject at: self ifAbsent: [nil]
-!
-
-reverseTrapAt: anObject put: value
-	^anObject at: self put: value
-! !
-