|
@@ -198,15 +198,15 @@ selector: "initialize",
|
|
category: 'initialization',
|
|
category: 'initialization',
|
|
fn: function (){
|
|
fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
-function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
|
|
|
|
|
|
+function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
|
|
smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
|
|
-self["@subscriptions"]=_st($Array())._new();
|
|
|
|
|
|
+self["@subscriptions"]=_st($OrderedCollection())._new();
|
|
return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Announcer)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Announcer)})},
|
|
args: [],
|
|
args: [],
|
|
-source: "initialize\x0a\x09super initialize.\x0a\x09subscriptions := Array new",
|
|
|
|
|
|
+source: "initialize\x0a\x09super initialize.\x0a\x09subscriptions := OrderedCollection new",
|
|
messageSends: ["initialize", "new"],
|
|
messageSends: ["initialize", "new"],
|
|
-referencedClasses: ["Array"]
|
|
|
|
|
|
+referencedClasses: ["OrderedCollection"]
|
|
}),
|
|
}),
|
|
smalltalk.Announcer);
|
|
smalltalk.Announcer);
|
|
|
|
|
|
@@ -232,6 +232,52 @@ referencedClasses: ["AnnouncementSubscription"]
|
|
}),
|
|
}),
|
|
smalltalk.Announcer);
|
|
smalltalk.Announcer);
|
|
|
|
|
|
|
|
+smalltalk.addMethod(
|
|
|
|
+smalltalk.method({
|
|
|
|
+selector: "on:send:to:",
|
|
|
|
+category: 'subscribing',
|
|
|
|
+fn: function (aClass,aSelector,anObject){
|
|
|
|
+var self=this;
|
|
|
|
+function $MessageSend(){return smalltalk.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
|
|
|
|
+function $AnnouncementSubscription(){return smalltalk.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
|
|
|
|
+return smalltalk.withContext(function($ctx1) {
|
|
|
|
+var $1,$2,$3,$4;
|
|
|
|
+$1=_st($AnnouncementSubscription())._new();
|
|
|
|
+$2=_st($MessageSend())._new();
|
|
|
|
+_st($2)._receiver_(anObject);
|
|
|
|
+_st($2)._selector_(aString);
|
|
|
|
+$3=_st($2)._yourself();
|
|
|
|
+_st($1)._valuable_($3);
|
|
|
|
+_st($1)._announcementClass_(aClass);
|
|
|
|
+$4=_st($1)._yourself();
|
|
|
|
+_st(self["@subscriptions"])._add_($4);
|
|
|
|
+return self}, function($ctx1) {$ctx1.fill(self,"on:send:to:",{aClass:aClass,aSelector:aSelector,anObject:anObject},smalltalk.Announcer)})},
|
|
|
|
+args: ["aClass", "aSelector", "anObject"],
|
|
|
|
+source: "on: aClass send: aSelector to: anObject\x0a\x09subscriptions add: (AnnouncementSubscription new\x0a\x09\x09valuable: (MessageSend new\x0a\x09\x09\x09receiver: anObject;\x0a\x09\x09\x09selector: aString;\x0a\x09\x09\x09yourself);\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself)",
|
|
|
|
+messageSends: ["add:", "valuable:", "receiver:", "new", "selector:", "yourself", "announcementClass:"],
|
|
|
|
+referencedClasses: ["MessageSend", "AnnouncementSubscription"]
|
|
|
|
+}),
|
|
|
|
+smalltalk.Announcer);
|
|
|
|
+
|
|
|
|
+smalltalk.addMethod(
|
|
|
|
+smalltalk.method({
|
|
|
|
+selector: "unsubscribe:",
|
|
|
|
+category: 'subscribing',
|
|
|
|
+fn: function (anObject){
|
|
|
|
+var self=this;
|
|
|
|
+return smalltalk.withContext(function($ctx1) {
|
|
|
|
+self["@subscriptions"]=_st(self["@subscriptions"])._reject_((function(each){
|
|
|
|
+return smalltalk.withContext(function($ctx2) {
|
|
|
|
+return _st(_st(each)._receiver()).__eq(anObject);
|
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
|
|
|
+return self}, function($ctx1) {$ctx1.fill(self,"unsubscribe:",{anObject:anObject},smalltalk.Announcer)})},
|
|
|
|
+args: ["anObject"],
|
|
|
|
+source: "unsubscribe: anObject\x0a\x09subscriptions := subscriptions reject: [ :each |\x0a\x09\x09each receiver = anObject ]",
|
|
|
|
+messageSends: ["reject:", "=", "receiver"],
|
|
|
|
+referencedClasses: []
|
|
|
|
+}),
|
|
|
|
+smalltalk.Announcer);
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
smalltalk.addClass('SystemAnnouncer', smalltalk.Announcer, [], 'Kernel-Announcements');
|
|
smalltalk.addClass('SystemAnnouncer', smalltalk.Announcer, [], 'Kernel-Announcements');
|