Browse Source

PluggableInterest, related simplifications.

Herbert Vojčík 6 years ago
parent
commit
8d53c7d387
2 changed files with 8 additions and 16 deletions
  1. 6 14
      src/Trapped.js
  2. 2 2
      src/Trapped.st

+ 6 - 14
src/Trapped.js

@@ -446,7 +446,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$3,$2;
+var $1;
 $1=$recv($recv(anAspect)._notEmpty())._and_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -457,17 +457,9 @@ return $recv($recv(anAspect)._last())._isNil();
 //>>excludeEnd("ctx");
 }));
 if($core.assert($1)){
-$3=$recv($globals.InterestedThruAxes)._new();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["new"]=1;
-//>>excludeEnd("ctx");
-$2=$recv($3)._aspect_block_($recv(anAspect)._allButLast(),aBlock);
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["aspect:block:"]=1;
-//>>excludeEnd("ctx");
-return $2;
+return $recv($globals.Axes)._newInterestThru_doing_($recv(anAspect)._allButLast(),aBlock);
 } else {
-return $recv($recv($globals.InterestedUpToAxes)._new())._aspect_block_(anAspect,aBlock);
+return $recv($globals.Axes)._newInterestUpTo_doing_(anAspect,aBlock);
 }
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -476,10 +468,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anAspect", "aBlock"],
-source: "interestOn: anAspect block: aBlock\x0a\x09(anAspect notEmpty and: [ anAspect last isNil ])\x0a\x09\x09ifTrue: [ ^ InterestedThruAxes new aspect: anAspect allButLast block: aBlock ]\x0a\x09\x09ifFalse: [ ^ InterestedUpToAxes new aspect: anAspect block: aBlock ]",
-referencedClasses: ["InterestedThruAxes", "InterestedUpToAxes"],
+source: "interestOn: anAspect block: aBlock\x0a\x09(anAspect notEmpty and: [ anAspect last isNil ])\x0a\x09\x09ifTrue: [ ^ Axes newInterestThru: anAspect allButLast doing: aBlock ]\x0a\x09\x09ifFalse: [ ^ Axes newInterestUpTo: anAspect doing: aBlock ]",
+referencedClasses: ["Axes"],
 //>>excludeEnd("ide");
-messageSends: ["ifTrue:ifFalse:", "and:", "notEmpty", "isNil", "last", "aspect:block:", "new", "allButLast"]
+messageSends: ["ifTrue:ifFalse:", "and:", "notEmpty", "isNil", "last", "newInterestThru:doing:", "allButLast", "newInterestUpTo:doing:"]
 }),
 $globals.TrappedPosition.a$cls);
 

+ 2 - 2
src/Trapped.st

@@ -115,8 +115,8 @@ watch: aBlock
 
 interestOn: anAspect block: aBlock
 	(anAspect notEmpty and: [ anAspect last isNil ])
-		ifTrue: [ ^ InterestedThruAxes new aspect: anAspect allButLast block: aBlock ]
-		ifFalse: [ ^ InterestedUpToAxes new aspect: anAspect block: aBlock ]
+		ifTrue: [ ^ Axes newInterestThru: anAspect allButLast doing: aBlock ]
+		ifFalse: [ ^ Axes newInterestUpTo: anAspect doing: aBlock ]
 ! !
 
 TrappedPosition subclass: #TrappedSnapshot