Browse Source

NonBooleanReceiver class >> signalOn:

To shorten list of kernel-used APIs.
Herbert Vojčík 5 months ago
parent
commit
38f4e624ac
5 changed files with 38 additions and 4 deletions
  1. 2 0
      API-CHANGES.txt
  2. 1 3
      CHANGELOG
  3. 26 0
      src/Kernel-Exceptions.js
  4. 8 0
      src/Kernel-Exceptions.st
  5. 1 1
      support/kernel-runtime.js

+ 2 - 0
API-CHANGES.txt

@@ -12,6 +12,8 @@
12 12
 + MethodContext
13 13
   + stubHere
14 14
   + stubToAtMost:
15
++ NonBooleanReceiver class >>
16
+  + signalOn:
15 17
 + UndefinedObject >>
16 18
   + ==
17 19
 

+ 1 - 3
CHANGELOG

@@ -8,9 +8,7 @@
8 8
   * Dictionary class >> newFromPairs:
9 9
   * ErrorHandler class >> handleError:
10 10
   * JSObjectProxy class >> on:
11
-  * NonBooleanReceiver class >> new
12
-  * NonBooleanReceiver >> object:
13
-  * NonBooleanReceiver >> signal
11
+  * NonBooleanReceiver class >> signalOn:
14 12
 
15 13
 Commits: https://lolg.it/amber/amber/commits/0.19.1.
16 14
 

+ 26 - 0
src/Kernel-Exceptions.js

@@ -881,4 +881,30 @@ messageSends: []
881 881
 $globals.NonBooleanReceiver);
882 882
 
883 883
 
884
+$core.addMethod(
885
+$core.method({
886
+selector: "signalOn:",
887
+protocol: "instance creation",
888
+fn: function (anObject){
889
+var self=this,$self=this;
890
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
891
+return $core.withContext(function($ctx1) {
892
+//>>excludeEnd("ctx");
893
+var $1;
894
+$1=$self._new();
895
+$recv($1)._object_(anObject);
896
+return $recv($1)._signal();
897
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
898
+}, function($ctx1) {$ctx1.fill(self,"signalOn:",{anObject:anObject},$globals.NonBooleanReceiver.a$cls)});
899
+//>>excludeEnd("ctx");
900
+},
901
+//>>excludeStart("ide", pragmas.excludeIdeData);
902
+args: ["anObject"],
903
+source: "signalOn: anObject\x0a\x09^ self new\x0a\x09\x09object: anObject;\x0a\x09\x09signal",
904
+referencedClasses: [],
905
+//>>excludeEnd("ide");
906
+messageSends: ["object:", "new", "signal"]
907
+}),
908
+$globals.NonBooleanReceiver.a$cls);
909
+
884 910
 });

+ 8 - 0
src/Kernel-Exceptions.st

@@ -236,3 +236,11 @@ object: anObject
236 236
 	object := anObject
237 237
 ! !
238 238
 
239
+!NonBooleanReceiver class methodsFor: 'instance creation'!
240
+
241
+signalOn: anObject
242
+	^ self new
243
+		object: anObject;
244
+		signal
245
+! !
246
+

+ 1 - 1
support/kernel-runtime.js

@@ -226,7 +226,7 @@ define(function () {
226 226
                 shouldBeBoolean = shouldBeBoolean.valueOf();
227 227
                 if (typeof shouldBeBoolean === "boolean") return shouldBeBoolean;
228 228
             }
229
-            globals.NonBooleanReceiver._new()._object_(shouldBeBoolean)._signal();
229
+            globals.NonBooleanReceiver._signalOn_(shouldBeBoolean);
230 230
         };
231 231
 
232 232
         // TODO remove