|
@@ -144,6 +144,75 @@ messageSends: []
|
|
|
}),
|
|
|
$globals.Thenable);
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "then:catch:",
|
|
|
+protocol: 'promises',
|
|
|
+fn: function (aBlockOrArray,anotherBlock){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+return $recv(self._then_(aBlockOrArray))._catch_(anotherBlock);
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"then:catch:",{aBlockOrArray:aBlockOrArray,anotherBlock:anotherBlock},$globals.Thenable)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: ["aBlockOrArray", "anotherBlock"],
|
|
|
+source: "then: aBlockOrArray catch: anotherBlock\x0a\x09^ (self then: aBlockOrArray) catch: anotherBlock",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["catch:", "then:"]
|
|
|
+}),
|
|
|
+$globals.Thenable);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "then:on:do:",
|
|
|
+protocol: 'promises',
|
|
|
+fn: function (aBlockOrArray,aClass,aBlock){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+return $recv(self._then_(aBlockOrArray))._on_do_(aClass,aBlock);
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"then:on:do:",{aBlockOrArray:aBlockOrArray,aClass:aClass,aBlock:aBlock},$globals.Thenable)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: ["aBlockOrArray", "aClass", "aBlock"],
|
|
|
+source: "then: aBlockOrArray on: aClass do: aBlock\x0a\x09^ (self then: aBlockOrArray) on: aClass do: aBlock",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["on:do:", "then:"]
|
|
|
+}),
|
|
|
+$globals.Thenable);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "then:on:do:catch:",
|
|
|
+protocol: 'promises',
|
|
|
+fn: function (aBlockOrArray,aClass,aBlock,anotherBlock){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+return $recv($recv(self._then_(aBlockOrArray))._on_do_(aClass,aBlock))._catch_(anotherBlock);
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"then:on:do:catch:",{aBlockOrArray:aBlockOrArray,aClass:aClass,aBlock:aBlock,anotherBlock:anotherBlock},$globals.Thenable)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: ["aBlockOrArray", "aClass", "aBlock", "anotherBlock"],
|
|
|
+source: "then: aBlockOrArray on: aClass do: aBlock catch: anotherBlock\x0a\x09^ ((self then: aBlockOrArray) on: aClass do: aBlock) catch: anotherBlock",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["catch:", "on:do:", "then:"]
|
|
|
+}),
|
|
|
+$globals.Thenable);
|
|
|
+
|
|
|
|
|
|
|
|
|
$core.addClass('Promise', $globals.Thenable, [], 'Kernel-Promises');
|