Browse Source

Fixing bug: clearing flag before running action block.

If flaggibg occured from within action block, it was cleared\
in ensure: [ flagged := false ].
Herbert Vojčík 11 years ago
parent
commit
ac9389107e
2 changed files with 5 additions and 10 deletions
  1. 4 9
      lib/js/Trapped-Backend.js
  2. 1 1
      lib/st/Trapped-Backend.st

+ 4 - 9
lib/js/Trapped-Backend.js

@@ -508,14 +508,9 @@ function $KeyedPubSubUnsubscribe(){return smalltalk.KeyedPubSubUnsubscribe||(typ
 return smalltalk.withContext(function($ctx1) { 
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st((function(){
-return smalltalk.withContext(function($ctx3) {
-return _st(self["@actionBlock"])._value();
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))._ensure_((function(){
-return smalltalk.withContext(function($ctx3) {
 self["@flagged"]=false;
-return self["@flagged"];
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
+self["@flagged"];
+return _st(self["@actionBlock"])._value();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($KeyedPubSubUnsubscribe(),(function(){
 return smalltalk.withContext(function($ctx2) {
 self["@actionBlock"]=nil;
@@ -523,8 +518,8 @@ return self["@actionBlock"];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"run",{},smalltalk.KeyedSubscriptionBase)})},
 args: [],
-source: "run\x0a\x09[[ actionBlock value ] ensure: [ flagged := false ]]\x0a    on: KeyedPubSubUnsubscribe do: [ actionBlock := nil ]",
-messageSends: ["on:do:", "ensure:", "value"],
+source: "run\x0a\x09[ flagged := false. actionBlock value ]\x0a    on: KeyedPubSubUnsubscribe do: [ actionBlock := nil ]",
+messageSends: ["on:do:", "value"],
 referencedClasses: ["KeyedPubSubUnsubscribe"]
 }),
 smalltalk.KeyedSubscriptionBase);

+ 1 - 1
lib/st/Trapped-Backend.st

@@ -183,7 +183,7 @@ key: anObject block: aBlock
 !KeyedSubscriptionBase methodsFor: 'action'!
 
 run
-	[[ actionBlock value ] ensure: [ flagged := false ]]
+	[ flagged := false. actionBlock value ]
     on: KeyedPubSubUnsubscribe do: [ actionBlock := nil ]
 ! !