The Trunk: Environments-topa.54.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Environments-topa.54.mcz

commits-2
Tobias Pape uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-topa.54.mcz

==================== Summary ====================

Name: Environments-topa.54
Author: topa
Time: 20 January 2015, 4:12:36.674 pm
UUID: b55bd16f-c2c0-4927-b170-4954383dd63f
Ancestors: Environments-cmm.53

Update literal bindings in compiled methods when renaming a class.

Restores working behavior of pre-Squeak4.5.

=============== Diff against Environments-cmm.53 ===============

Item was changed:
  ----- Method: Environment>>renameClass:from:to: (in category 'classes and traits') -----
  renameClass: aClass from: oldName to: newName
  "Rename the class, aClass, to have the title newName."
 
  | binding category |
  category := self organization categoryOfElement: oldName.
  self organization classify: newName under: category suppressIfDefault: true.
  self organization removeElement: oldName.
 
+ binding := self declarationOf: oldName.
- binding := self associationAt: oldName.
  declarations removeKey: oldName.
+ self binding: binding removedFrom: self.
+ undeclared removeKey: oldName.
+
+ binding becomeForward: (newName => aClass).
+ declarations add: binding.
+ self binding: binding addedTo: self.
- bindings removeKey: oldName.
- " self binding: binding removedFrom: self."
 
- binding key: newName.
- declarations add: binding.
- bindings add: binding.
- " self binding: binding addedTo: self."
-
  Smalltalk renamedClass: aClass from: oldName to: newName.
  SystemChangeNotifier uniqueInstance
  classRenamed: aClass
  from: oldName
  to: newName
  inCategory: category!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Environments-topa.54.mcz

Chris Muller-3
A more-proper fix that seems to work, thanks.

On Tue, Jan 20, 2015 at 9:12 AM, <[hidden email]> wrote:
Tobias Pape uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-topa.54.mcz

==================== Summary ====================

Name: Environments-topa.54
Author: topa
Time: 20 January 2015, 4:12:36.674 pm
UUID: b55bd16f-c2c0-4927-b170-4954383dd63f
Ancestors: Environments-cmm.53

Update literal bindings in compiled methods when renaming a class.

Restores working behavior of pre-Squeak4.5.

=============== Diff against Environments-cmm.53 ===============

Item was changed:
  ----- Method: Environment>>renameClass:from:to: (in category 'classes and traits') -----
  renameClass: aClass from: oldName to: newName
        "Rename the class, aClass, to have the title newName."

        | binding category |
        category := self organization categoryOfElement: oldName.
        self organization classify: newName under: category suppressIfDefault: true.
        self organization removeElement: oldName.

+       binding := self declarationOf: oldName.
-       binding := self associationAt: oldName.
        declarations removeKey: oldName.
+       self binding: binding removedFrom: self.
+       undeclared removeKey: oldName.
+
+       binding becomeForward: (newName => aClass).
+       declarations add: binding.
+       self binding: binding addedTo: self.
-       bindings removeKey: oldName.
- "     self binding: binding removedFrom: self."

-       binding key: newName.
-       declarations add: binding.
-       bindings add: binding.
- "     self binding: binding addedTo: self."
-
        Smalltalk renamedClass: aClass from: oldName to: newName.
        SystemChangeNotifier uniqueInstance
                classRenamed: aClass
                from: oldName
                to: newName
                inCategory: category!