|
@@ -319,6 +319,74 @@ $globals.AnnouncerTest);
|
|
|
|
|
|
|
|
|
$core.addClass('BlockClosureTest', $globals.TestCase, [], 'Kernel-Tests');
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "localReturnOnDoCatch",
|
|
|
+protocol: 'fixture',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+var $early={};
|
|
|
+try {
|
|
|
+$recv((function(){
|
|
|
+throw $early=[(2)];
|
|
|
+
|
|
|
+}))._on_do_($Error(),(function(){
|
|
|
+
|
|
|
+}));
|
|
|
+return (3);
|
|
|
+}
|
|
|
+catch(e) {if(e===$early)return e[0]; throw e}
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"localReturnOnDoCatch",{},$globals.BlockClosureTest)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "localReturnOnDoCatch\x0a [ ^ 2 ] on: Error do: [].\x0a ^ 3",
|
|
|
+referencedClasses: ["Error"],
|
|
|
+
|
|
|
+messageSends: ["on:do:"]
|
|
|
+}),
|
|
|
+$globals.BlockClosureTest);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "localReturnOnDoMiss",
|
|
|
+protocol: 'fixture',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+function $Class(){return $globals.Class||(typeof Class=="undefined"?nil:Class)}
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+var $early={};
|
|
|
+try {
|
|
|
+$recv((function(){
|
|
|
+throw $early=[(2)];
|
|
|
+
|
|
|
+}))._on_do_($Class(),(function(){
|
|
|
+
|
|
|
+}));
|
|
|
+return (3);
|
|
|
+}
|
|
|
+catch(e) {if(e===$early)return e[0]; throw e}
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"localReturnOnDoMiss",{},$globals.BlockClosureTest)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "localReturnOnDoMiss\x0a [ ^ 2 ] on: Class do: [].\x0a ^ 3",
|
|
|
+referencedClasses: ["Class"],
|
|
|
+
|
|
|
+messageSends: ["on:do:"]
|
|
|
+}),
|
|
|
+$globals.BlockClosureTest);
|
|
|
+
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "testCanClearInterval",
|
|
@@ -617,6 +685,54 @@ messageSends: ["timeout:", "valueWithTimeout:", "async:", "on:do:", "assert:", "
|
|
|
}),
|
|
|
$globals.BlockClosureTest);
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "testLocalReturnOnDoCatch",
|
|
|
+protocol: 'tests',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+self._assert_equals_(self._localReturnOnDoCatch(),(2));
|
|
|
+return self;
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"testLocalReturnOnDoCatch",{},$globals.BlockClosureTest)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "testLocalReturnOnDoCatch\x0a\x09self assert: self localReturnOnDoCatch equals: 2",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["assert:equals:", "localReturnOnDoCatch"]
|
|
|
+}),
|
|
|
+$globals.BlockClosureTest);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "testLocalReturnOnDoMiss",
|
|
|
+protocol: 'tests',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+self._assert_equals_(self._localReturnOnDoMiss(),(2));
|
|
|
+return self;
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"testLocalReturnOnDoMiss",{},$globals.BlockClosureTest)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "testLocalReturnOnDoMiss\x0a\x09self assert: self localReturnOnDoMiss equals: 2",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["assert:equals:", "localReturnOnDoMiss"]
|
|
|
+}),
|
|
|
+$globals.BlockClosureTest);
|
|
|
+
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "testNewWithValues",
|