|
@@ -1329,6 +1329,42 @@ messageSends: ["ifNotNil:", "at:", "globals", "error:", ",", "renameClass:to:",
|
|
|
}),
|
|
|
$globals.Environment);
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "renamePackage:to:",
|
|
|
+protocol: 'actions',
|
|
|
+fn: function (aPackageName,aNewPackageName){
|
|
|
+var self=this;
|
|
|
+function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+var $1,$2,$receiver;
|
|
|
+$1=$recv($recv($Smalltalk())._globals())._at_(aNewPackageName);
|
|
|
+if(($receiver = $1) == null || $receiver.isNil){
|
|
|
+$1;
|
|
|
+} else {
|
|
|
+$2=$recv("A package named ".__comma(aNewPackageName)).__comma(" already exists");
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+$ctx1.sendIdx[","]=1;
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+self._error_($2);
|
|
|
+};
|
|
|
+$recv($Smalltalk())._renamePackage_to_(aPackageName,aNewPackageName);
|
|
|
+return self;
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{aPackageName:aPackageName,aNewPackageName:aNewPackageName},$globals.Environment)});
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+},
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: ["aPackageName", "aNewPackageName"],
|
|
|
+source: "renamePackage: aPackageName to: aNewPackageName\x0a (Smalltalk globals at: aNewPackageName)\x0a ifNotNil: [ self error: 'A package named ', aNewPackageName, ' already exists' ].\x0a\x0a Smalltalk renamePackage: aPackageName to: aNewPackageName",
|
|
|
+referencedClasses: ["Smalltalk"],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+messageSends: ["ifNotNil:", "at:", "globals", "error:", ",", "renamePackage:to:"]
|
|
|
+}),
|
|
|
+$globals.Environment);
|
|
|
+
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "renameProtocol:to:in:",
|