Просмотр исходного кода

Fix for 'package' being a reserved word in js and not good for temp names in Amber. We need to warn about this when saving methods.

Göran Krampe 12 лет назад
Родитель
Сommit
687441f9a7
9 измененных файлов с 38 добавлено и 49 удалено
  1. 1 1
      js/Compiler.deploy.js
  2. 2 2
      js/Compiler.js
  3. 1 5
      js/IDE.deploy.js
  4. 5 9
      js/IDE.js
  5. 7 7
      js/Kernel.deploy.js
  6. 10 10
      js/Kernel.js
  7. 2 2
      st/Compiler.st
  8. 3 6
      st/IDE.st
  9. 7 7
      st/Kernel.st

+ 1 - 1
js/Compiler.deploy.js

@@ -162,7 +162,7 @@ smalltalk.method({
 selector: 'exportAll',
 fn: function (){
 var self=this;
-return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packages", []), "_do_", [(function(package){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_exportPackage_", [smalltalk.send(package, "_name", [])])]);})]);})]);
+return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packages", []), "_do_", [(function(pkg){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_exportPackage_", [smalltalk.send(pkg, "_name", [])])]);})]);})]);
 return self;}
 }),
 smalltalk.Exporter);

+ 2 - 2
js/Compiler.js

@@ -223,10 +223,10 @@ selector: unescape('exportAll'),
 category: 'fileOut',
 fn: function (){
 var self=this;
-return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packages", []), "_do_", [(function(package){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_exportPackage_", [smalltalk.send(package, "_name", [])])]);})]);})]);
+return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packages", []), "_do_", [(function(pkg){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_exportPackage_", [smalltalk.send(pkg, "_name", [])])]);})]);})]);
 return self;},
 args: [],
-source: unescape('exportAll%0A%20%20%20%20%22Export%20all%20packages%20in%20the%20system.%22%0A%0A%20%20%20%20%5EString%20streamContents%3A%20%5B%3Astream%20%7C%0A%20%20%20%20%09Smalltalk%20current%20packages%20do%3A%20%5B%3Apackage%20%7C%0A%09%09stream%20nextPutAll%3A%20%28self%20exportPackage%3A%20package%20name%29%5D%5D'),
+source: unescape('exportAll%0A%20%20%20%20%22Export%20all%20packages%20in%20the%20system.%22%0A%0A%20%20%20%20%5EString%20streamContents%3A%20%5B%3Astream%20%7C%0A%20%20%20%20%09Smalltalk%20current%20packages%20do%3A%20%5B%3Apkg%20%7C%0A%09%09stream%20nextPutAll%3A%20%28self%20exportPackage%3A%20pkg%20name%29%5D%5D'),
 messageSends: ["streamContents:", "do:", "packages", "current", "nextPutAll:", "exportPackage:", "name"],
 referencedClasses: [smalltalk.String,smalltalk.Smalltalk]
 }),

+ 1 - 5
js/IDE.deploy.js

@@ -1182,8 +1182,6 @@ selector: 'renamePackage',
 fn: function (){
 var self=this;
 var newName=nil;
-var package=nil;
-package=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [self['@selectedPackage']]);
 newName=smalltalk.send(self, "_prompt_", [smalltalk.send("Rename package ", "__comma", [self['@selectedPackage']])]);
 (($receiver = smalltalk.send(newName, "_notEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_renamePackage_to_", [self['@selectedPackage'], newName]);return smalltalk.send(self, "_updateCategoriesList", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_renamePackage_to_", [self['@selectedPackage'], newName]);return smalltalk.send(self, "_updateCategoriesList", []);})]);
 return self;}
@@ -1196,9 +1194,7 @@ smalltalk.method({
 selector: 'removePackage',
 fn: function (){
 var self=this;
-var package=nil;
-package=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [self['@selectedPackage']]);
-(($receiver = smalltalk.send(self, "_confirm_", [smalltalk.send(smalltalk.send("Do you really want to remove the whole package ", "__comma", [smalltalk.send(package, "_name", [])]), "__comma", [unescape("%20with%20all%20its%20classes%3F")])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removePackage_", [smalltalk.send(package, "_name", [])]);return smalltalk.send(self, "_updateCategoriesList", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removePackage_", [smalltalk.send(package, "_name", [])]);return smalltalk.send(self, "_updateCategoriesList", []);})]);
+(($receiver = smalltalk.send(self, "_confirm_", [smalltalk.send(smalltalk.send("Do you really want to remove the whole package ", "__comma", [self['@selectedPackage']]), "__comma", [unescape("%20with%20all%20its%20classes%3F")])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removePackage_", [self['@selectedPackage']]);return smalltalk.send(self, "_updateCategoriesList", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removePackage_", [self['@selectedPackage']]);return smalltalk.send(self, "_updateCategoriesList", []);})]);
 return self;}
 }),
 smalltalk.Browser);

+ 5 - 9
js/IDE.js

@@ -1668,14 +1668,12 @@ category: 'actions',
 fn: function (){
 var self=this;
 var newName=nil;
-var package=nil;
-package=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [self['@selectedPackage']]);
 newName=smalltalk.send(self, "_prompt_", [smalltalk.send("Rename package ", "__comma", [self['@selectedPackage']])]);
 (($receiver = smalltalk.send(newName, "_notEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_renamePackage_to_", [self['@selectedPackage'], newName]);return smalltalk.send(self, "_updateCategoriesList", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_renamePackage_to_", [self['@selectedPackage'], newName]);return smalltalk.send(self, "_updateCategoriesList", []);})]);
 return self;},
 args: [],
-source: unescape('renamePackage%0A%0A%20%20%7C%20newName%20package%20%7C%0A%20%20package%20%3A%3D%20Smalltalk%20current%20packageAt%3A%20selectedPackage.%0A%20%20newName%20%3A%3D%20self%20prompt%3A%20%27Rename%20package%20%27%2C%20selectedPackage.%0A%20%20newName%20notEmpty%20ifTrue%3A%20%5B%0A%09Smalltalk%20current%20renamePackage%3A%20selectedPackage%20to%3A%20newName.%0A%09self%20updateCategoriesList%5D'),
-messageSends: ["packageAt:", "current", "prompt:", unescape("%2C"), "ifTrue:", "notEmpty", "renamePackage:to:", "updateCategoriesList"],
+source: unescape('renamePackage%0A%0A%20%20%7C%20newName%20%7C%0A%20%20newName%20%3A%3D%20self%20prompt%3A%20%27Rename%20package%20%27%2C%20selectedPackage.%0A%20%20newName%20notEmpty%20ifTrue%3A%20%5B%0A%09Smalltalk%20current%20renamePackage%3A%20selectedPackage%20to%3A%20newName.%0A%09self%20updateCategoriesList%5D'),
+messageSends: ["prompt:", unescape("%2C"), "ifTrue:", "notEmpty", "renamePackage:to:", "current", "updateCategoriesList"],
 referencedClasses: [smalltalk.Smalltalk]
 }),
 smalltalk.Browser);
@@ -1687,13 +1685,11 @@ selector: unescape('removePackage'),
 category: 'actions',
 fn: function (){
 var self=this;
-var package=nil;
-package=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [self['@selectedPackage']]);
-(($receiver = smalltalk.send(self, "_confirm_", [smalltalk.send(smalltalk.send("Do you really want to remove the whole package ", "__comma", [smalltalk.send(package, "_name", [])]), "__comma", [unescape("%20with%20all%20its%20classes%3F")])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removePackage_", [smalltalk.send(package, "_name", [])]);return smalltalk.send(self, "_updateCategoriesList", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removePackage_", [smalltalk.send(package, "_name", [])]);return smalltalk.send(self, "_updateCategoriesList", []);})]);
+(($receiver = smalltalk.send(self, "_confirm_", [smalltalk.send(smalltalk.send("Do you really want to remove the whole package ", "__comma", [self['@selectedPackage']]), "__comma", [unescape("%20with%20all%20its%20classes%3F")])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removePackage_", [self['@selectedPackage']]);return smalltalk.send(self, "_updateCategoriesList", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removePackage_", [self['@selectedPackage']]);return smalltalk.send(self, "_updateCategoriesList", []);})]);
 return self;},
 args: [],
-source: unescape('removePackage%0A%0A%20%20%7C%20package%20%7C%0A%20%20package%20%3A%3D%20Smalltalk%20current%20packageAt%3A%20selectedPackage.%0A%20%20%28self%20confirm%3A%20%27Do%20you%20really%20want%20to%20remove%20the%20whole%20package%20%27%2C%20package%20name%2C%20%27%20with%20all%20its%20classes%3F%27%29%0A%09ifTrue%3A%20%5B%0A%09%20%20%20%20Smalltalk%20current%20removePackage%3A%20package%20name.%0A%09%20%20%20%20self%20updateCategoriesList%5D'),
-messageSends: ["packageAt:", "current", "ifTrue:", "confirm:", unescape("%2C"), "name", "removePackage:", "updateCategoriesList"],
+source: unescape('removePackage%0A%0A%20%20%28self%20confirm%3A%20%27Do%20you%20really%20want%20to%20remove%20the%20whole%20package%20%27%2C%20selectedPackage%2C%20%27%20with%20all%20its%20classes%3F%27%29%0A%09ifTrue%3A%20%5B%0A%09%20%20%20%20Smalltalk%20current%20removePackage%3A%20selectedPackage.%0A%09%20%20%20%20self%20updateCategoriesList%5D'),
+messageSends: ["ifTrue:", "confirm:", unescape("%2C"), "removePackage:", "current", "updateCategoriesList"],
 referencedClasses: [smalltalk.Smalltalk]
 }),
 smalltalk.Browser);

+ 7 - 7
js/Kernel.deploy.js

@@ -719,9 +719,9 @@ smalltalk.method({
 selector: 'removePackage:',
 fn: function (packageName){
 var self=this;
-var package=nil;
-package=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
-smalltalk.send(smalltalk.send(package, "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_removeClass_", [each]);})]);
+var pkg=nil;
+pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
+smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_removeClass_", [each]);})]);
 smalltalk.send(self, "_deletePackage_", [packageName]);
 return self;}
 }),
@@ -733,11 +733,11 @@ smalltalk.method({
 selector: 'renamePackage:to:',
 fn: function (packageName, newName){
 var self=this;
-var package=nil;
-package=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
+var pkg=nil;
+pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
 (($receiver = smalltalk.send(self, "_packageAt_", [newName])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Already exists a package called: ", "__comma", [newName])]);})() : nil;
 smalltalk.packages[newName] = smalltalk.packages[packageName];
-smalltalk.send(package, "_name_", [newName]);
+smalltalk.send(pkg, "_name_", [newName]);
 smalltalk.send(self, "_deletePackage_", [packageName]);
 return self;}
 }),
@@ -1146,7 +1146,7 @@ smalltalk.method({
 selector: 'category',
 fn: function (){
 var self=this;
-return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
+return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "Unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
 return self;}
 }),
 smalltalk.Class);

+ 10 - 10
js/Kernel.js

@@ -1025,13 +1025,13 @@ selector: unescape('removePackage%3A'),
 category: 'packages',
 fn: function (packageName){
 var self=this;
-var package=nil;
-package=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
-smalltalk.send(smalltalk.send(package, "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_removeClass_", [each]);})]);
+var pkg=nil;
+pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
+smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_removeClass_", [each]);})]);
 smalltalk.send(self, "_deletePackage_", [packageName]);
 return self;},
 args: ["packageName"],
-source: unescape('removePackage%3A%20packageName%0A%09%22Removes%20a%20package%20and%20all%20its%20classes.%22%0A%0A%09%7C%20package%20%7C%0A%09package%20%3A%3D%20self%20packageAt%3A%20packageName%20ifAbsent%3A%20%5Bself%20error%3A%20%27Missing%20package%3A%20%27%2C%20packageName%5D.%0A%09package%20classes%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%20%20%20%20%09self%20removeClass%3A%20each%5D.%0A%09self%20deletePackage%3A%20packageName'),
+source: unescape('removePackage%3A%20packageName%0A%09%22Removes%20a%20package%20and%20all%20its%20classes.%22%0A%0A%09%7C%20pkg%20%7C%0A%09pkg%20%3A%3D%20self%20packageAt%3A%20packageName%20ifAbsent%3A%20%5Bself%20error%3A%20%27Missing%20package%3A%20%27%2C%20packageName%5D.%0A%09pkg%20classes%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%20%20%20%20%09self%20removeClass%3A%20each%5D.%0A%09self%20deletePackage%3A%20packageName'),
 messageSends: ["packageAt:ifAbsent:", "error:", unescape("%2C"), "do:", "classes", "removeClass:", "deletePackage:"],
 referencedClasses: []
 }),
@@ -1044,15 +1044,15 @@ selector: unescape('renamePackage%3Ato%3A'),
 category: 'packages',
 fn: function (packageName, newName){
 var self=this;
-var package=nil;
-package=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
+var pkg=nil;
+pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
 (($receiver = smalltalk.send(self, "_packageAt_", [newName])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Already exists a package called: ", "__comma", [newName])]);})() : nil;
 smalltalk.packages[newName] = smalltalk.packages[packageName];
-smalltalk.send(package, "_name_", [newName]);
+smalltalk.send(pkg, "_name_", [newName]);
 smalltalk.send(self, "_deletePackage_", [packageName]);
 return self;},
 args: ["packageName", "newName"],
-source: unescape('renamePackage%3A%20packageName%20to%3A%20newName%0A%09%22Rename%20a%20package.%22%0A%0A%09%7C%20package%20%7C%0A%09package%20%3A%3D%20self%20packageAt%3A%20packageName%20ifAbsent%3A%20%5Bself%20error%3A%20%27Missing%20package%3A%20%27%2C%20packageName%5D.%0A%09%28self%20packageAt%3A%20newName%29%20ifNotNil%3A%20%5Bself%20error%3A%20%27Already%20exists%20a%20package%20called%3A%20%27%2C%20newName%5D.%0A%09%3Csmalltalk.packages%5BnewName%5D%20%3D%20smalltalk.packages%5BpackageName%5D%3E.%0A%09package%20name%3A%20newName.%0A%09self%20deletePackage%3A%20packageName.'),
+source: unescape('renamePackage%3A%20packageName%20to%3A%20newName%0A%09%22Rename%20a%20package.%22%0A%0A%09%7C%20pkg%20%7C%0A%09pkg%20%3A%3D%20self%20packageAt%3A%20packageName%20ifAbsent%3A%20%5Bself%20error%3A%20%27Missing%20package%3A%20%27%2C%20packageName%5D.%0A%09%28self%20packageAt%3A%20newName%29%20ifNotNil%3A%20%5Bself%20error%3A%20%27Already%20exists%20a%20package%20called%3A%20%27%2C%20newName%5D.%0A%09%3Csmalltalk.packages%5BnewName%5D%20%3D%20smalltalk.packages%5BpackageName%5D%3E.%0A%09pkg%20name%3A%20newName.%0A%09self%20deletePackage%3A%20packageName.'),
 messageSends: ["packageAt:ifAbsent:", "error:", unescape("%2C"), "ifNotNil:", "packageAt:", "name:", "deletePackage:"],
 referencedClasses: []
 }),
@@ -1628,10 +1628,10 @@ selector: unescape('category'),
 category: 'accessing',
 fn: function (){
 var self=this;
-return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
+return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "Unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
 return self;},
 args: [],
-source: unescape('category%0A%09%5Eself%20package%20ifNil%3A%20%5B%27unclassified%27%5D%20ifNotNil%3A%20%5Bself%20package%20name%5D'),
+source: unescape('category%0A%09%5Eself%20package%20ifNil%3A%20%5B%27Unclassified%27%5D%20ifNotNil%3A%20%5Bself%20package%20name%5D'),
 messageSends: ["ifNil:ifNotNil:", "package", "name"],
 referencedClasses: []
 }),

+ 2 - 2
st/Compiler.st

@@ -91,8 +91,8 @@ exportAll
     "Export all packages in the system."
 
     ^String streamContents: [:stream |
-    	Smalltalk current packages do: [:package |
-		stream nextPutAll: (self exportPackage: package name)]]
+    	Smalltalk current packages do: [:pkg |
+		stream nextPutAll: (self exportPackage: pkg name)]]
 ! !
 
 !Exporter methodsFor: 'private'!

+ 3 - 6
st/IDE.st

@@ -780,8 +780,7 @@ commitPackage
 
 renamePackage
 
-  | newName package |
-  package := Smalltalk current packageAt: selectedPackage.
+  | newName |
   newName := self prompt: 'Rename package ', selectedPackage.
   newName notEmpty ifTrue: [
 	Smalltalk current renamePackage: selectedPackage to: newName.
@@ -790,11 +789,9 @@ renamePackage
 
 removePackage
 
-  | package |
-  package := Smalltalk current packageAt: selectedPackage.
-  (self confirm: 'Do you really want to remove the whole package ', package name, ' with all its classes?')
+  (self confirm: 'Do you really want to remove the whole package ', selectedPackage, ' with all its classes?')
 	ifTrue: [
-	    Smalltalk current removePackage: package name.
+	    Smalltalk current removePackage: selectedPackage.
 	    self updateCategoriesList]
 ! !
 

+ 7 - 7
st/Kernel.st

@@ -321,9 +321,9 @@ packageAt: packageName ifAbsent: aBlock
 removePackage: packageName
 	"Removes a package and all its classes."
 
-	| package |
-	package := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].
-	package classes do: [:each |
+	| pkg |
+	pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].
+	pkg classes do: [:each |
         	self removeClass: each].
 	self deletePackage: packageName
 !
@@ -331,11 +331,11 @@ removePackage: packageName
 renamePackage: packageName to: newName
 	"Rename a package."
 
-	| package |
-	package := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].
+	| pkg |
+	pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].
 	(self packageAt: newName) ifNotNil: [self error: 'Already exists a package called: ', newName].
 	<smalltalk.packages[newName] = smalltalk.packages[packageName]>.
-	package name: newName.
+	pkg name: newName.
 	self deletePackage: packageName.
 ! !
 
@@ -576,7 +576,7 @@ Behavior subclass: #Class
 !Class methodsFor: 'accessing'!
 
 category
-	^self package ifNil: ['unclassified'] ifNotNil: [self package name]
+	^self package ifNil: ['Unclassified'] ifNotNil: [self package name]
 !
 
 rename: aString