|
@@ -2139,6 +2139,74 @@ return self;
|
|
|
}; }),
|
|
|
$globals.CodeGeneratorInstallTest);
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "testNiladicJSOverrideDifferentNames",
|
|
|
+protocol: "tests",
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "testNiladicJSOverrideDifferentNames\x0a\x09receiver := ObjectMock new.\x0a\x09receiver foo: 4.\x0a\x09self while: 'quux <jsOverride: #mux> ^ (foo := foo + 3)' should: [\x0a\x09\x09self should: [ receiver mux ] raise: MessageNotUnderstood.\x0a\x09\x09self assert: (receiver basicPerform: #mux) equals: 7.\x0a\x09\x09self assert: receiver quux equals: 10.\x0a\x09\x09self should: [ receiver basicPerform: #quux ] raise: Error.\x0a\x09\x09self assert: receiver foo equals: 10 ]",
|
|
|
+referencedClasses: ["ObjectMock", "MessageNotUnderstood", "Error"],
|
|
|
+
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["new", "foo:", "while:should:", "should:raise:", "mux", "assert:equals:", "basicPerform:", "quux", "foo"]
|
|
|
+}, function ($methodClass){ return function (){
|
|
|
+var self=this,$self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+var $1;
|
|
|
+$self.receiver=$recv($globals.ObjectMock)._new();
|
|
|
+$recv($self.receiver)._foo_((4));
|
|
|
+$self._while_should_("quux <jsOverride: #mux> ^ (foo := foo + 3)",(function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
+
|
|
|
+$self._should_raise_((function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx3) {
|
|
|
+
|
|
|
+return $recv($self.receiver)._mux();
|
|
|
+
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
|
|
|
+
|
|
|
+}),$globals.MessageNotUnderstood);
|
|
|
+
|
|
|
+$ctx2.sendIdx["should:raise:"]=1;
|
|
|
+
|
|
|
+$1=$recv($self.receiver)._basicPerform_("mux");
|
|
|
+
|
|
|
+$ctx2.sendIdx["basicPerform:"]=1;
|
|
|
+
|
|
|
+$self._assert_equals_($1,(7));
|
|
|
+
|
|
|
+$ctx2.sendIdx["assert:equals:"]=1;
|
|
|
+
|
|
|
+$self._assert_equals_($recv($self.receiver)._quux(),(10));
|
|
|
+
|
|
|
+$ctx2.sendIdx["assert:equals:"]=2;
|
|
|
+
|
|
|
+$self._should_raise_((function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx3) {
|
|
|
+
|
|
|
+return $recv($self.receiver)._basicPerform_("quux");
|
|
|
+
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
|
|
|
+
|
|
|
+}),$globals.Error);
|
|
|
+return $self._assert_equals_($recv($self.receiver)._foo(),(10));
|
|
|
+
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
+
|
|
|
+}));
|
|
|
+return self;
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"testNiladicJSOverrideDifferentNames",{})});
|
|
|
+
|
|
|
+}; }),
|
|
|
+$globals.CodeGeneratorInstallTest);
|
|
|
+
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "testPragmaInBlock",
|