Browse Source

Subscriptions do not react on subitem changes.

Herbert Vojčík 12 years ago
parent
commit
9613ccbb06
3 changed files with 9 additions and 11 deletions
  1. 3 3
      js/Trapped-Backend.deploy.js
  2. 5 5
      js/Trapped-Backend.js
  3. 1 3
      st/Trapped-Backend.st

+ 3 - 3
js/Trapped-Backend.deploy.js

@@ -216,9 +216,9 @@ selector: "accepts:",
 fn: function (aPath){
 var self=this;
 var $1;
-var lesser;
-lesser=smalltalk.send(smalltalk.send(self["@path"],"_size",[]),"_min_",[smalltalk.send(aPath,"_size",[])]);
-$1=smalltalk.send(smalltalk.send(aPath,"_copyFrom_to_",[(1),lesser]),"__eq",[smalltalk.send(self["@path"],"_copyFrom_to_",[(1),lesser])]);
+$1=smalltalk.send(smalltalk.send(smalltalk.send(aPath,"_size",[]),"__lt_eq",[smalltalk.send(self["@path"],"_size",[])]),"_and_",[(function(){
+return smalltalk.send(aPath,"__eq",[smalltalk.send(self["@path"],"_copyFrom_to_",[(1),smalltalk.send(aPath,"_size",[])])]);
+})]);
 return $1;
 }
 }),

+ 5 - 5
js/Trapped-Backend.js

@@ -289,14 +289,14 @@ category: 'testing',
 fn: function (aPath){
 var self=this;
 var $1;
-var lesser;
-lesser=smalltalk.send(smalltalk.send(self["@path"],"_size",[]),"_min_",[smalltalk.send(aPath,"_size",[])]);
-$1=smalltalk.send(smalltalk.send(aPath,"_copyFrom_to_",[(1),lesser]),"__eq",[smalltalk.send(self["@path"],"_copyFrom_to_",[(1),lesser])]);
+$1=smalltalk.send(smalltalk.send(smalltalk.send(aPath,"_size",[]),"__lt_eq",[smalltalk.send(self["@path"],"_size",[])]),"_and_",[(function(){
+return smalltalk.send(aPath,"__eq",[smalltalk.send(self["@path"],"_copyFrom_to_",[(1),smalltalk.send(aPath,"_size",[])])]);
+})]);
 return $1;
 },
 args: ["aPath"],
-source: "accepts: aPath\x0a    | lesser |\x0a    lesser := path size min: aPath size.\x0a    ^(aPath copyFrom: 1 to: lesser) = (path copyFrom: 1 to: lesser)",
-messageSends: ["min:", "size", "=", "copyFrom:to:"],
+source: "accepts: aPath\x0a    ^aPath size <= path size and: [aPath = (path copyFrom: 1 to: aPath size)]",
+messageSends: ["and:", "=", "copyFrom:to:", "size", "<="],
 referencedClasses: []
 }),
 smalltalk.TrappedSubscription);

+ 1 - 3
st/Trapped-Backend.st

@@ -157,9 +157,7 @@ initialize
 !TrappedSubscription methodsFor: 'testing'!
 
 accepts: aPath
-    | lesser |
-    lesser := path size min: aPath size.
-    ^(aPath copyFrom: 1 to: lesser) = (path copyFrom: 1 to: lesser)
+    ^aPath size <= path size and: [aPath = (path copyFrom: 1 to: aPath size)]
 !
 
 isEnabled