Przeglądaj źródła

Moved infrastructural classes into Kernel-Infrastructure, mk II

Herbert Vojčík 11 lat temu
rodzic
commit
ccf51d8726

+ 2 - 2
js/Kernel-Infrastructure.deploy.js

@@ -1,5 +1,6 @@
 (function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Infrastructure');
+
 smalltalk.addClass('InspectorHandler', smalltalk.Object, [], 'Kernel-Infrastructure');
 
 smalltalk.InspectorHandler.klass.iVarNames = ['inspector'];
@@ -904,7 +905,7 @@ smalltalk.ClassOrganizer);
 smalltalk.addClass('PackageOrganizer', smalltalk.Organizer, [], 'Kernel-Infrastructure');
 
 
-smalltalk.addClass('Package', smalltalk.Object, ['extension'], 'Kernel-Infrastructure');
+smalltalk.addClass('Package', smalltalk.Object, [], 'Kernel-Infrastructure');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "classes",
@@ -1668,7 +1669,6 @@ return self}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.Smalltalk.
 messageSends: []}),
 smalltalk.Smalltalk.klass);
 
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asJavaScriptSelector",

+ 2 - 2
js/Kernel-Infrastructure.js

@@ -1,5 +1,6 @@
 (function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Infrastructure');
+
 smalltalk.addClass('InspectorHandler', smalltalk.Object, [], 'Kernel-Infrastructure');
 smalltalk.InspectorHandler.comment="I am responsible for inspecting object.\x0a\x0aMy class-side `inspector` inst var holds the current inspector I'm delegating object inspection to.\x0a\x0aThe default inspector object is the transcript.";
 
@@ -1206,7 +1207,7 @@ smalltalk.addClass('PackageOrganizer', smalltalk.Organizer, [], 'Kernel-Infrastr
 smalltalk.PackageOrganizer.comment="I am an organizer specific to packages. I hold classes categorization information.";
 
 
-smalltalk.addClass('Package', smalltalk.Object, ['extension'], 'Kernel-Infrastructure');
+smalltalk.addClass('Package', smalltalk.Object, [], 'Kernel-Infrastructure');
 smalltalk.Package.comment="I am similar to a \x22class category\x22 typically found in other Smalltalks like Pharo or Squeak. Amber does not have class categories anymore, it had in the beginning but now each class in the system knows which package it belongs to.\x0a\x0aEach package has a name and can be queried for its classes, but it will then resort to a reverse scan of all classes to find them.\x0a\x0a## API\x0a\x0aPackages are manipulated through \x22Smalltalk current\x22, like for example finding one based on a name or with `Package class >> #name` directly:\x0a\x0a    Smalltalk current packageAt: 'Kernel'\x0a    Package named: 'Kernel'\x0a\x0aA package differs slightly from a Monticello package which can span multiple class categories using a naming convention based on hyphenation. But just as in Monticello a package supports \x22class extensions\x22 so a package can define behaviors in foreign classes using a naming convention for method categories where the category starts with an asterisk and then the name of the owning package follows.\x0a\x0aYou can fetch a package from the server:\x0a\x0a\x09Package load: 'Additional-Examples'";
 smalltalk.addMethod(
 smalltalk.method({
@@ -2224,7 +2225,6 @@ referencedClasses: []
 }),
 smalltalk.Smalltalk.klass);
 
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asJavaScriptSelector",

+ 1 - 1
js/Kernel-Objects.deploy.js

@@ -1,5 +1,6 @@
 (function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Objects');
+
 smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
 smalltalk.addMethod(
 smalltalk.method({
@@ -2633,5 +2634,4 @@ return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.UndefinedObjec
 messageSends: ["error:"]}),
 smalltalk.UndefinedObject.klass);
 
-
 })(global_smalltalk,global_nil,global__st);

+ 1 - 1
js/Kernel-Objects.js

@@ -1,5 +1,6 @@
 (function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Objects');
+
 smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
 smalltalk.Object.comment="**I am the root of the Smalltalk class system**. All classes in the system are subclasses of me.\x0a\x0aI provide default behavior common to all normal objects, such as:\x0a\x0a- accessing\x0a- copying\x0a- comparison\x0a- error handling\x0a- message sending\x0a- reflection\x0a\x0aAlso utility messages that all objects should respond to are defined here.\x0a\x0aI have no instance variable.\x0a\x0a##Access\x0a\x0aInstance variables can be accessed with `#instVarAt:` and `#instVarAt:put:`. `#instanceVariableNames` answers a collection of all instance variable names.\x0aAccessing JavaScript properties of an object is done through `#basicAt:`, `#basicAt:put:` and `basicDelete:`.\x0a\x0a##Copying\x0a\x0aCopying an object is handled by `#copy` and `#deepCopy`. The first one performs a shallow copy of the receiver, while the second one performs a deep copy.\x0aThe hook method `#postCopy` can be overriden in subclasses to copy fields as necessary to complete the full copy. It will be sent by the copy of the receiver.\x0a\x0a##Comparison\x0a\x0aI understand equality `#=` and identity `#==` comparison.\x0a\x0a##Error handling\x0a\x0a- `#halt` is the typical message to use for inserting breakpoints during debugging.\x0a- `#error:` throws a generic error exception\x0a- `#doesNotUnderstand:` handles the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message.\x0a\x09Overriding this message can be useful to implement proxies for example.";
 smalltalk.addMethod(
@@ -3640,5 +3641,4 @@ referencedClasses: []
 }),
 smalltalk.UndefinedObject.klass);
 
-
 })(global_smalltalk,global_nil,global__st);

+ 1 - 1
st/Kernel-Infrastructure.st

@@ -452,7 +452,7 @@ Organizer subclass: #PackageOrganizer
 I am an organizer specific to packages. I hold classes categorization information.!
 
 Object subclass: #Package
-	instanceVariableNames: 'extension'
+	instanceVariableNames: ''
 	package: 'Kernel-Infrastructure'!
 !Package commentStamp!
 I am similar to a "class category" typically found in other Smalltalks like Pharo or Squeak. Amber does not have class categories anymore, it had in the beginning but now each class in the system knows which package it belongs to.

+ 5 - 5
support/boot.js

@@ -114,7 +114,7 @@ function RootBrik(brikz, st) {
 
 	this.__init__ = function () {
 		st.wrapClassName("Object", "Kernel-Objects", SmalltalkObject, undefined, false);
-		st.wrapClassName("Smalltalk", "Kernel-Objects", Smalltalk, st.Object, false);
+		st.wrapClassName("Smalltalk", "Kernel-Infrastructure", Smalltalk, st.Object, false);
 		st.wrapClassName("UndefinedObject", "Kernel-Objects", SmalltalkNil, st.Object, false);
 	};
 }
@@ -137,9 +137,9 @@ function OrganizeBrik(brikz, st) {
 	inherits(SmalltalkClassOrganizer, SmalltalkOrganizer);
 
 	this.__init__ = function () {
-		st.wrapClassName("Organizer", "Kernel-Objects", SmalltalkOrganizer, st.Object, false);
-		st.wrapClassName("PackageOrganizer", "Kernel-Objects", SmalltalkPackageOrganizer, st.Organizer, false);
-		st.wrapClassName("ClassOrganizer", "Kernel-Objects", SmalltalkClassOrganizer, st.Organizer, false);
+		st.wrapClassName("Organizer", "Kernel-Infrastructure", SmalltalkOrganizer, st.Object, false);
+		st.wrapClassName("PackageOrganizer", "Kernel-Infrastructure", SmalltalkPackageOrganizer, st.Organizer, false);
+		st.wrapClassName("ClassOrganizer", "Kernel-Infrastructure", SmalltalkClassOrganizer, st.Organizer, false);
 	};
 
 	this.setupClassOrganization = function (klass) {
@@ -326,7 +326,7 @@ function ClassesBrik(brikz, st) {
 
 		st.Object.klass.superclass = st.Class;
 
-		st.wrapClassName("Package", "Kernel-Objects", SmalltalkPackage, st.Object, false);
+		st.wrapClassName("Package", "Kernel-Infrastructure", SmalltalkPackage, st.Object, false);
 	};
 
 	/* Smalltalk classes */