|
@@ -2219,16 +2219,16 @@ $globals.AbstractCodeGeneratorInstallTest);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "shouldntInstall:",
|
|
|
+selector: "shouldntInstall:andRaise:",
|
|
|
protocol: "testing",
|
|
|
|
|
|
-args: ["aString"],
|
|
|
-source: "shouldntInstall: aString\x0a\x09| method |\x0a\x0a\x09[ self\x0a\x09\x09should: [ method := self install: aString forClass: receiver class ]\x0a\x09\x09raise: ParseError ]\x0a\x09ensure: [ method ifNotNil: [ receiver class removeCompiledMethod: method ] ]",
|
|
|
-referencedClasses: ["ParseError"],
|
|
|
+args: ["aString", "anErrorClass"],
|
|
|
+source: "shouldntInstall: aString andRaise: anErrorClass\x0a\x09| method |\x0a\x0a\x09[ self\x0a\x09\x09should: [ method := self install: aString forClass: receiver class ]\x0a\x09\x09raise: anErrorClass ]\x0a\x09ensure: [ method ifNotNil: [ receiver class removeCompiledMethod: method ] ]",
|
|
|
+referencedClasses: [],
|
|
|
|
|
|
pragmas: [],
|
|
|
messageSends: ["ensure:", "should:raise:", "install:forClass:", "class", "ifNotNil:", "removeCompiledMethod:"]
|
|
|
-}, function ($methodClass){ return function (aString){
|
|
|
+}, function ($methodClass){ return function (aString,anErrorClass){
|
|
|
var self=this,$self=this;
|
|
|
var method;
|
|
|
|
|
@@ -2252,7 +2252,7 @@ return method;
|
|
|
|
|
|
}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
|
|
|
|
|
|
-}),$globals.ParseError);
|
|
|
+}),anErrorClass);
|
|
|
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
|
|
@@ -2272,7 +2272,41 @@ return $recv($recv($self.receiver)._class())._removeCompiledMethod_(method);
|
|
|
}));
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"shouldntInstall:",{aString:aString,method:method})});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"shouldntInstall:andRaise:",{aString:aString,anErrorClass:anErrorClass,method:method})});
|
|
|
+
|
|
|
+}; }),
|
|
|
+$globals.AbstractCodeGeneratorInstallTest);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "testInvalidAssignment",
|
|
|
+protocol: "tests",
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "testInvalidAssignment\x0a\x09self shouldntInstall: 'foo:a a:=1' andRaise: InvalidAssignmentError.\x0a\x09self shouldntInstall: 'foo false:=1' andRaise: InvalidAssignmentError.\x0a\x09self shouldntInstall: 'foo Number:=1' andRaise: InvalidAssignmentError\x0a",
|
|
|
+referencedClasses: ["InvalidAssignmentError"],
|
|
|
+
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["shouldntInstall:andRaise:"]
|
|
|
+}, function ($methodClass){ return function (){
|
|
|
+var self=this,$self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+[$self._shouldntInstall_andRaise_("foo:a a:=1",$globals.InvalidAssignmentError)
|
|
|
+
|
|
|
+,$ctx1.sendIdx["shouldntInstall:andRaise:"]=1
|
|
|
+
|
|
|
+][0];
|
|
|
+[$self._shouldntInstall_andRaise_("foo false:=1",$globals.InvalidAssignmentError)
|
|
|
+
|
|
|
+,$ctx1.sendIdx["shouldntInstall:andRaise:"]=2
|
|
|
+
|
|
|
+][0];
|
|
|
+$self._shouldntInstall_andRaise_("foo Number:=1",$globals.InvalidAssignmentError);
|
|
|
+return self;
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"testInvalidAssignment",{})});
|
|
|
|
|
|
}; }),
|
|
|
$globals.AbstractCodeGeneratorInstallTest);
|
|
@@ -2283,17 +2317,17 @@ selector: "testMistypedPragmaJSStatement",
|
|
|
protocol: "tests",
|
|
|
|
|
|
args: [],
|
|
|
-source: "testMistypedPragmaJSStatement\x0a\x09self shouldntInstall: 'foo < inlineJS: ''return ''foo'''' >'",
|
|
|
-referencedClasses: [],
|
|
|
+source: "testMistypedPragmaJSStatement\x0a\x09self shouldntInstall: 'foo < inlineJS: ''return ''foo'''' >' andRaise: ParseError",
|
|
|
+referencedClasses: ["ParseError"],
|
|
|
|
|
|
pragmas: [],
|
|
|
-messageSends: ["shouldntInstall:"]
|
|
|
+messageSends: ["shouldntInstall:andRaise:"]
|
|
|
}, function ($methodClass){ return function (){
|
|
|
var self=this,$self=this;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-$self._shouldntInstall_("foo < inlineJS: 'return 'foo'' >");
|
|
|
+$self._shouldntInstall_andRaise_("foo < inlineJS: 'return 'foo'' >",$globals.ParseError);
|
|
|
return self;
|
|
|
|
|
|
}, function($ctx1) {$ctx1.fill(self,"testMistypedPragmaJSStatement",{})});
|
|
@@ -2430,17 +2464,17 @@ selector: "testPragmaInBlock",
|
|
|
protocol: "tests",
|
|
|
|
|
|
args: [],
|
|
|
-source: "testPragmaInBlock\x0a\x09self shouldntInstall: 'foo ^ [ < fooBar > 4 ] value'",
|
|
|
-referencedClasses: [],
|
|
|
+source: "testPragmaInBlock\x0a\x09self shouldntInstall: 'foo ^ [ < fooBar > 4 ] value' andRaise: ParseError",
|
|
|
+referencedClasses: ["ParseError"],
|
|
|
|
|
|
pragmas: [],
|
|
|
-messageSends: ["shouldntInstall:"]
|
|
|
+messageSends: ["shouldntInstall:andRaise:"]
|
|
|
}, function ($methodClass){ return function (){
|
|
|
var self=this,$self=this;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-$self._shouldntInstall_("foo ^ [ < fooBar > 4 ] value");
|
|
|
+$self._shouldntInstall_andRaise_("foo ^ [ < fooBar > 4 ] value",$globals.ParseError);
|
|
|
return self;
|
|
|
|
|
|
}, function($ctx1) {$ctx1.fill(self,"testPragmaInBlock",{})});
|