Browse Source

Merge branch 'master' into requirejs

Conflicts:
	bin/amberc.js
	support/boot.js
Herbert Vojčík 10 years ago
parent
commit
9dcf2ccc31
10 changed files with 376 additions and 57 deletions
  1. 3 0
      .gitignore
  2. 9 1
      Gruntfile.js
  3. 1 1
      bower.json
  4. 2 2
      js/Helios-Core.deploy.js
  5. 3 3
      js/Helios-Core.js
  6. 115 9
      js/Importer-Exporter.deploy.js
  7. 161 15
      js/Importer-Exporter.js
  8. 1 1
      st/Helios-Core.st
  9. 49 8
      st/Importer-Exporter.st
  10. 32 17
      support/boot.js

+ 3 - 0
.gitignore

@@ -16,3 +16,6 @@ test/run.js
 
 # Ignoring local NPM modules
 /node_modules/*
+
+# Ignoring local bower modules
+/bower_components/*

+ 9 - 1
Gruntfile.js

@@ -39,8 +39,16 @@ module.exports = function(grunt) {
               'st/Importer-Exporter.st', 'st/Compiler-Exceptions.st', 'st/Compiler-Core.st', 'st/Compiler-AST.st',
               'st/Compiler-IR.st', 'st/Compiler-Inlining.st', 'st/Compiler-Semantic.st',
               'st/Canvas.st', 'st/SUnit.st', 'st/IDE.st',
-              'st/Kernel-Tests.st', 'st/Compiler-Tests.st', 'st/SUnit-Tests.st'
+              'st/Kernel-Tests.st', 'st/Compiler-Tests.st', 'st/SUnit-Tests.st',
+              'st/Helios-Core.st', 'st/Helios-Exceptions.st', 'st/Helios-Announcements.st',
+              'st/Helios-KeyBindings.st', 'st/Helios-Layout.st',
+              'st/Helios-Commands.st', 'st/Helios-Commands-Core.st', 'st/Helios-Commands-Browser.st', 'st/Helios-Commands-Tools.st',
+              'st/Helios-References.st', 'st/Helios-Inspector.st', 'st/Helios-Browser.st',
+              'st/Helios-Transcript.st', 'st/Helios-Workspace.st', 'st/Helios-Debugger.st',
+              'st/Helios-Workspace-Tests.st',
+              'st/Benchfib.st', 'st/Examples.st', 'st/Spaces.st'
               ],
+        jsGlobals: ['navigator'],
         deploy: true
       },
       amber_kernel: {

+ 1 - 1
bower.json

@@ -1,7 +1,7 @@
 {
   "name": "amber",
   "version": "0.11.0",
-  "main": "js/amber.js",
+  "main": "support/amber.js",
   "ignore": [
     "**/.*",
     "node_modules",

+ 2 - 2
js/Helios-Core.deploy.js

@@ -1639,7 +1639,7 @@ smalltalk.method({
 selector: "ensureVisible:",
 fn: function (aListItem){
 var self=this;
-var perent,position;
+var parent,position;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 position=self._positionOf_(aListItem);
@@ -1652,7 +1652,7 @@ $2=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height
 if(smalltalk.assert($2)){
 _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(aListItem)._height())).__minus(_st(_st(parent)._height()).__minus(_st(_st(aListItem)._position())._top()))).__plus((10)));
 };
-return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,perent:perent,position:position},smalltalk.HLListWidget)})},
+return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,parent:parent,position:position},smalltalk.HLListWidget)})},
 messageSends: ["positionOf:", "parent", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "get:", "<", "height", ">"]}),
 smalltalk.HLListWidget);
 

+ 3 - 3
js/Helios-Core.js

@@ -2176,7 +2176,7 @@ selector: "ensureVisible:",
 category: 'actions',
 fn: function (aListItem){
 var self=this;
-var perent,position;
+var parent,position;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 position=self._positionOf_(aListItem);
@@ -2189,9 +2189,9 @@ $2=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height
 if(smalltalk.assert($2)){
 _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(aListItem)._height())).__minus(_st(_st(parent)._height()).__minus(_st(_st(aListItem)._position())._top()))).__plus((10)));
 };
-return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,perent:perent,position:position},smalltalk.HLListWidget)})},
+return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,parent:parent,position:position},smalltalk.HLListWidget)})},
 args: ["aListItem"],
-source: "ensureVisible: aListItem\x09\x0a\x09\x22Move the scrollbar to show the active element\x22\x0a\x09\x0a\x09| perent position |\x0a\x09\x0a\x09position := self positionOf: aListItem.\x0a\x09parent := aListItem parent.\x0a\x09\x0a    aListItem position top < 0 ifTrue: [\x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem position top - 10) ].\x0a    aListItem position top + aListItem height > parent height ifTrue: [ \x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem height - (parent height - aListItem position top)) +10 ]",
+source: "ensureVisible: aListItem\x09\x0a\x09\x22Move the scrollbar to show the active element\x22\x0a\x09\x0a\x09| parent position |\x0a\x09\x0a\x09position := self positionOf: aListItem.\x0a\x09parent := aListItem parent.\x0a\x09\x0a    aListItem position top < 0 ifTrue: [\x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem position top - 10) ].\x0a    aListItem position top + aListItem height > parent height ifTrue: [ \x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem height - (parent height - aListItem position top)) +10 ]",
 messageSends: ["positionOf:", "parent", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "get:", "<", "height", ">"],
 referencedClasses: []
 }),

+ 115 - 9
js/Importer-Exporter.deploy.js

@@ -145,10 +145,10 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=aStream;
-_st($1)._nextPutAll_("!".__comma(self._classNameFor_(_st(category)._at_("class"))));
-$2=_st($1)._nextPutAll_(_st(" methodsFor: '".__comma(_st(category)._at_("name"))).__comma("'!"));
+_st($1)._nextPutAll_("!".__comma(self._classNameFor_(_st(category)._klass())));
+$2=_st($1)._nextPutAll_(_st(" methodsFor: '".__comma(_st(category)._name())).__comma("'!"));
 return self}, function($ctx1) {$ctx1.fill(self,"exportCategoryPrologueOf:on:",{category:category,aStream:aStream},smalltalk.ChunkExporter.klass)})},
-messageSends: ["nextPutAll:", ",", "classNameFor:", "at:"]}),
+messageSends: ["nextPutAll:", ",", "classNameFor:", "klass", "name"]}),
 smalltalk.ChunkExporter.klass);
 
 smalltalk.addMethod(
@@ -260,6 +260,7 @@ var self=this;
 var name,map,result;
 function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
+function $MethodCategory(){return smalltalk.MethodCategory||(typeof MethodCategory=="undefined"?nil:MethodCategory)}
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
 return smalltalk.withContext(function($ctx1) { 
@@ -284,14 +285,14 @@ return smalltalk.withContext(function($ctx4) {
 return _st(a).__lt_eq(b);
 }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._collect_((function(category){
 return smalltalk.withContext(function($ctx4) {
-return smalltalk.HashedCollection._from_(["methods".__minus_gt(_st(map)._at_(category)),"name".__minus_gt(category),"class".__minus_gt(aClass)]);
+return _st($MethodCategory())._name_class_methods_(category,aClass,_st(map)._at_(category));
 }, function($ctx4) {$ctx4.fillBlock({category:category},$ctx3)})})));
 }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 $2=result;
 return $2;
 }, function($ctx1) {$ctx1.fill(self,"extensionCategoriesOfPackage:",{package_:package_,name:name,map:map,result:result},smalltalk.ChunkExporter.klass)})},
-messageSends: ["name", "new", "do:", "protocolsDo:", "ifTrue:", "at:put:", "match:", ",", "addAll:", "collect:", "->", "at:", "sorted:", "<=", "keys", "class", "sortedClasses:", "classes", "current"]}),
+messageSends: ["name", "new", "do:", "protocolsDo:", "ifTrue:", "at:put:", "match:", ",", "addAll:", "collect:", "name:class:methods:", "at:", "sorted:", "<=", "keys", "class", "sortedClasses:", "classes", "current"]}),
 smalltalk.ChunkExporter.klass);
 
 smalltalk.addMethod(
@@ -301,13 +302,13 @@ fn: function (category){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(category)._at_("methods"))._sorted_((function(a,b){
+$1=_st(_st(category)._methods())._sorted_((function(a,b){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"methodsOfCategory:",{category:category},smalltalk.ChunkExporter.klass)})},
-messageSends: ["sorted:", "<=", "selector", "at:"]}),
+messageSends: ["sorted:", "<=", "selector", "methods"]}),
 smalltalk.ChunkExporter.klass);
 
 smalltalk.addMethod(
@@ -317,6 +318,7 @@ fn: function (aClass){
 var self=this;
 var map;
 function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
+function $MethodCategory(){return smalltalk.MethodCategory||(typeof MethodCategory=="undefined"?nil:MethodCategory)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 map=_st($Dictionary())._new();
@@ -332,11 +334,11 @@ return smalltalk.withContext(function($ctx2) {
 return _st(a).__lt_eq(b);
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._collect_((function(category){
 return smalltalk.withContext(function($ctx2) {
-return smalltalk.HashedCollection._from_(["methods".__minus_gt(_st(map)._at_(category)),"name".__minus_gt(category),"class".__minus_gt(aClass)]);
+return _st($MethodCategory())._name_class_methods_(category,aClass,_st(map)._at_(category));
 }, function($ctx2) {$ctx2.fillBlock({category:category},$ctx1)})}));
 return $2;
 }, function($ctx1) {$ctx1.fill(self,"ownCategoriesOfClass:",{aClass:aClass,map:map},smalltalk.ChunkExporter.klass)})},
-messageSends: ["new", "protocolsDo:", "ifFalse:", "at:put:", "match:", "collect:", "->", "at:", "sorted:", "<=", "keys"]}),
+messageSends: ["new", "protocolsDo:", "ifFalse:", "at:put:", "match:", "collect:", "name:class:methods:", "at:", "sorted:", "<=", "keys"]}),
 smalltalk.ChunkExporter.klass);
 
 smalltalk.addMethod(
@@ -802,6 +804,99 @@ smalltalk.Importer);
 
 
 
+smalltalk.addClass('MethodCategory', smalltalk.Object, ['methods', 'name', 'klass'], 'Importer-Exporter');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "klass",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@klass"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"klass",{},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "klass:",
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@klass"]=aClass;
+return self}, function($ctx1) {$ctx1.fill(self,"klass:",{aClass:aClass},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methods",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@methods"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"methods",{},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methods:",
+fn: function (anArray){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@methods"]=anArray;
+return self}, function($ctx1) {$ctx1.fill(self,"methods:",{anArray:anArray},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@name"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name:",
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@name"]=aString;
+return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name:class:methods:",
+fn: function (aString,aClass,anArray){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
+$2=self._new();
+_st($2)._name_(aString);
+_st($2)._klass_(aClass);
+_st($2)._methods_(anArray);
+$3=_st($2)._yourself();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"name:class:methods:",{aString:aString,aClass:aClass,anArray:anArray},smalltalk.MethodCategory.klass)})},
+messageSends: ["name:", "new", "klass:", "methods:", "yourself"]}),
+smalltalk.MethodCategory.klass);
+
+
 smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
 smalltalk.addMethod(
 smalltalk.method({
@@ -841,6 +936,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},sma
 messageSends: ["do:displayingProgress:", "value:", "streamContents:", "exportPackage:on:", "newUsing:", "key", "ajaxPutAt:data:", "value", ",", "name", "commitChannels"]}),
 smalltalk.PackageHandler);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "commitChannels",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self._subclassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.PackageHandler)})},
+messageSends: ["subclassResponsibility"]}),
+smalltalk.PackageHandler);
+
 
 smalltalk.PackageHandler.klass.iVarNames = ['registry'];
 smalltalk.addMethod(

+ 161 - 15
js/Importer-Exporter.js

@@ -182,12 +182,12 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=aStream;
-_st($1)._nextPutAll_("!".__comma(self._classNameFor_(_st(category)._at_("class"))));
-$2=_st($1)._nextPutAll_(_st(" methodsFor: '".__comma(_st(category)._at_("name"))).__comma("'!"));
+_st($1)._nextPutAll_("!".__comma(self._classNameFor_(_st(category)._klass())));
+$2=_st($1)._nextPutAll_(_st(" methodsFor: '".__comma(_st(category)._name())).__comma("'!"));
 return self}, function($ctx1) {$ctx1.fill(self,"exportCategoryPrologueOf:on:",{category:category,aStream:aStream},smalltalk.ChunkExporter.klass)})},
 args: ["category", "aStream"],
-source: "exportCategoryPrologueOf: category on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: (category at: #class));\x0a\x09\x09nextPutAll: ' methodsFor: ''', (category at: #name), '''!'",
-messageSends: ["nextPutAll:", ",", "classNameFor:", "at:"],
+source: "exportCategoryPrologueOf: category on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: category klass);\x0a\x09\x09nextPutAll: ' methodsFor: ''', category name, '''!'",
+messageSends: ["nextPutAll:", ",", "classNameFor:", "klass", "name"],
 referencedClasses: []
 }),
 smalltalk.ChunkExporter.klass);
@@ -322,6 +322,7 @@ var self=this;
 var name,map,result;
 function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
+function $MethodCategory(){return smalltalk.MethodCategory||(typeof MethodCategory=="undefined"?nil:MethodCategory)}
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
 return smalltalk.withContext(function($ctx1) { 
@@ -346,7 +347,7 @@ return smalltalk.withContext(function($ctx4) {
 return _st(a).__lt_eq(b);
 }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._collect_((function(category){
 return smalltalk.withContext(function($ctx4) {
-return smalltalk.HashedCollection._from_(["methods".__minus_gt(_st(map)._at_(category)),"name".__minus_gt(category),"class".__minus_gt(aClass)]);
+return _st($MethodCategory())._name_class_methods_(category,aClass,_st(map)._at_(category));
 }, function($ctx4) {$ctx4.fillBlock({category:category},$ctx3)})})));
 }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
@@ -354,9 +355,9 @@ $2=result;
 return $2;
 }, function($ctx1) {$ctx1.fill(self,"extensionCategoriesOfPackage:",{package_:package_,name:name,map:map,result:result},smalltalk.ChunkExporter.klass)})},
 args: ["package"],
-source: "extensionCategoriesOfPackage: package\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| name map result |\x0a\x09name := package name.\x0a\x09result := OrderedCollection new.\x0a\x09(Package sortedClasses: Smalltalk current classes) do: [:each |\x0a\x09\x09{each. each class} do: [:aClass |\x0a\x09\x09\x09map := Dictionary new.\x0a\x09\x09\x09aClass protocolsDo: [:category :methods |\x0a\x09\x09\x09\x09(category match: '^\x5c*', name) ifTrue: [ map at: category put: methods ]].\x0a\x09\x09\x09result addAll: ((map keys sorted: [:a :b | a <= b ]) collect: [:category |\x0a\x09\x09\x09\x09#{ 'methods'->(map at: category). 'name'->category. 'class'->aClass}]) ]].\x0a\x09^result",
-messageSends: ["name", "new", "do:", "protocolsDo:", "ifTrue:", "at:put:", "match:", ",", "addAll:", "collect:", "->", "at:", "sorted:", "<=", "keys", "class", "sortedClasses:", "classes", "current"],
-referencedClasses: ["OrderedCollection", "Dictionary", "Smalltalk", "Package"]
+source: "extensionCategoriesOfPackage: package\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| name map result |\x0a\x09name := package name.\x0a\x09result := OrderedCollection new.\x0a\x09(Package sortedClasses: Smalltalk current classes) do: [:each |\x0a\x09\x09{each. each class} do: [:aClass |\x0a\x09\x09\x09map := Dictionary new.\x0a\x09\x09\x09aClass protocolsDo: [:category :methods |\x0a\x09\x09\x09\x09(category match: '^\x5c*', name) ifTrue: [ map at: category put: methods ]].\x0a\x09\x09\x09result addAll: ((map keys sorted: [:a :b | a <= b ]) collect: [:category |\x0a\x09\x09\x09\x09MethodCategory name: category class: aClass methods: (map at: category)]) ]].\x0a\x09^result",
+messageSends: ["name", "new", "do:", "protocolsDo:", "ifTrue:", "at:put:", "match:", ",", "addAll:", "collect:", "name:class:methods:", "at:", "sorted:", "<=", "keys", "class", "sortedClasses:", "classes", "current"],
+referencedClasses: ["OrderedCollection", "Dictionary", "MethodCategory", "Smalltalk", "Package"]
 }),
 smalltalk.ChunkExporter.klass);
 
@@ -368,15 +369,15 @@ fn: function (category){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(category)._at_("methods"))._sorted_((function(a,b){
+$1=_st(_st(category)._methods())._sorted_((function(a,b){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"methodsOfCategory:",{category:category},smalltalk.ChunkExporter.klass)})},
 args: ["category"],
-source: "methodsOfCategory: category\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09^(category at: #methods) sorted: [:a :b | a selector <= b selector]",
-messageSends: ["sorted:", "<=", "selector", "at:"],
+source: "methodsOfCategory: category\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09^(category methods) sorted: [:a :b | a selector <= b selector]",
+messageSends: ["sorted:", "<=", "selector", "methods"],
 referencedClasses: []
 }),
 smalltalk.ChunkExporter.klass);
@@ -389,6 +390,7 @@ fn: function (aClass){
 var self=this;
 var map;
 function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
+function $MethodCategory(){return smalltalk.MethodCategory||(typeof MethodCategory=="undefined"?nil:MethodCategory)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 map=_st($Dictionary())._new();
@@ -404,14 +406,14 @@ return smalltalk.withContext(function($ctx2) {
 return _st(a).__lt_eq(b);
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._collect_((function(category){
 return smalltalk.withContext(function($ctx2) {
-return smalltalk.HashedCollection._from_(["methods".__minus_gt(_st(map)._at_(category)),"name".__minus_gt(category),"class".__minus_gt(aClass)]);
+return _st($MethodCategory())._name_class_methods_(category,aClass,_st(map)._at_(category));
 }, function($ctx2) {$ctx2.fillBlock({category:category},$ctx1)})}));
 return $2;
 }, function($ctx1) {$ctx1.fill(self,"ownCategoriesOfClass:",{aClass:aClass,map:map},smalltalk.ChunkExporter.klass)})},
 args: ["aClass"],
-source: "ownCategoriesOfClass: aClass\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| map |\x0a\x09map := Dictionary new.\x0a\x09aClass protocolsDo: [:category :methods |\x0a\x09\x09(category match: '^\x5c*') ifFalse: [ map at: category put: methods ]].\x0a\x09^(map keys sorted: [:a :b | a <= b ]) collect: [:category |\x0a\x09\x09#{\x0a\x09\x09\x09'methods'->(map at: category).\x0a\x09\x09\x09'name'->category.\x0a\x09\x09\x09'class'->aClass }]",
-messageSends: ["new", "protocolsDo:", "ifFalse:", "at:put:", "match:", "collect:", "->", "at:", "sorted:", "<=", "keys"],
-referencedClasses: ["Dictionary"]
+source: "ownCategoriesOfClass: aClass\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| map |\x0a\x09map := Dictionary new.\x0a\x09aClass protocolsDo: [:category :methods |\x0a\x09\x09(category match: '^\x5c*') ifFalse: [ map at: category put: methods ]].\x0a\x09^(map keys sorted: [:a :b | a <= b ]) collect: [:category |\x0a\x09\x09MethodCategory name: category class: aClass methods: (map at: category) ]",
+messageSends: ["new", "protocolsDo:", "ifFalse:", "at:put:", "match:", "collect:", "name:class:methods:", "at:", "sorted:", "<=", "keys"],
+referencedClasses: ["Dictionary", "MethodCategory"]
 }),
 smalltalk.ChunkExporter.klass);
 
@@ -982,6 +984,134 @@ smalltalk.Importer);
 
 
 
+smalltalk.addClass('MethodCategory', smalltalk.Object, ['methods', 'name', 'klass'], 'Importer-Exporter');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "klass",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@klass"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"klass",{},smalltalk.MethodCategory)})},
+args: [],
+source: "klass\x0a\x09^klass",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "klass:",
+category: 'accessing',
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@klass"]=aClass;
+return self}, function($ctx1) {$ctx1.fill(self,"klass:",{aClass:aClass},smalltalk.MethodCategory)})},
+args: ["aClass"],
+source: "klass: aClass\x0a\x09klass := aClass",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methods",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@methods"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"methods",{},smalltalk.MethodCategory)})},
+args: [],
+source: "methods\x0a\x09^methods",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methods:",
+category: 'accessing',
+fn: function (anArray){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@methods"]=anArray;
+return self}, function($ctx1) {$ctx1.fill(self,"methods:",{anArray:anArray},smalltalk.MethodCategory)})},
+args: ["anArray"],
+source: "methods: anArray\x0a\x09methods := anArray",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@name"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.MethodCategory)})},
+args: [],
+source: "name\x0a\x09^name",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name:",
+category: 'accessing',
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@name"]=aString;
+return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.MethodCategory)})},
+args: ["aString"],
+source: "name: aString\x0a\x09name := aString",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name:class:methods:",
+category: 'not yet classified',
+fn: function (aString,aClass,anArray){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
+$2=self._new();
+_st($2)._name_(aString);
+_st($2)._klass_(aClass);
+_st($2)._methods_(anArray);
+$3=_st($2)._yourself();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"name:class:methods:",{aString:aString,aClass:aClass,anArray:anArray},smalltalk.MethodCategory.klass)})},
+args: ["aString", "aClass", "anArray"],
+source: "name: aString class: aClass methods: anArray\x0a\x09^self new\x0a\x09\x09name: aString;\x0a\x09\x09klass: aClass;\x0a\x09\x09methods: anArray;\x0a\x09\x09yourself",
+messageSends: ["name:", "new", "klass:", "methods:", "yourself"],
+referencedClasses: []
+}),
+smalltalk.MethodCategory.klass);
+
+
 smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
 smalltalk.PackageHandler.comment="I am responsible for handling package loading and committing.\x0a\x0aI should not be used directly. Instead, use the corresponding `Package` methods.";
 smalltalk.addMethod(
@@ -1032,6 +1162,22 @@ referencedClasses: ["PluggableExporter", "String"]
 }),
 smalltalk.PackageHandler);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "commitChannels",
+category: 'committing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self._subclassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.PackageHandler)})},
+args: [],
+source: "commitChannels\x0a\x09self subclassResponsibility",
+messageSends: ["subclassResponsibility"],
+referencedClasses: []
+}),
+smalltalk.PackageHandler);
+
 
 smalltalk.PackageHandler.klass.iVarNames = ['registry'];
 smalltalk.addMethod(

+ 1 - 1
st/Helios-Core.st

@@ -816,7 +816,7 @@ activatePreviousListItem
 ensureVisible: aListItem	
 	"Move the scrollbar to show the active element"
 	
-	| perent position |
+	| parent position |
 	
 	position := self positionOf: aListItem.
 	parent := aListItem parent.

+ 49 - 8
st/Importer-Exporter.st

@@ -64,14 +64,14 @@ extensionCategoriesOfPackage: package
 			aClass protocolsDo: [:category :methods |
 				(category match: '^\*', name) ifTrue: [ map at: category put: methods ]].
 			result addAll: ((map keys sorted: [:a :b | a <= b ]) collect: [:category |
-				#{ 'methods'->(map at: category). 'name'->category. 'class'->aClass}]) ]].
+				MethodCategory name: category class: aClass methods: (map at: category)]) ]].
 	^result
 !
 
 methodsOfCategory: category
 	"Issue #143: sort methods alphabetically"
 
-	^(category at: #methods) sorted: [:a :b | a selector <= b selector]
+	^(category methods) sorted: [:a :b | a selector <= b selector]
 !
 
 ownCategoriesOfClass: aClass
@@ -82,10 +82,7 @@ ownCategoriesOfClass: aClass
 	aClass protocolsDo: [:category :methods |
 		(category match: '^\*') ifFalse: [ map at: category put: methods ]].
 	^(map keys sorted: [:a :b | a <= b ]) collect: [:category |
-		#{
-			'methods'->(map at: category).
-			'name'->category.
-			'class'->aClass }]
+		MethodCategory name: category class: aClass methods: (map at: category) ]
 !
 
 ownCategoriesOfMetaClass: aClass
@@ -102,8 +99,8 @@ exportCategoryEpilogueOf: category on: aStream
 
 exportCategoryPrologueOf: category on: aStream
 	aStream
-		nextPutAll: '!!', (self classNameFor: (category at: #class));
-		nextPutAll: ' methodsFor: ''', (category at: #name), '''!!'
+		nextPutAll: '!!', (self classNameFor: category klass);
+		nextPutAll: ' methodsFor: ''', category name, '''!!'
 !
 
 exportDefinitionOf: aClass on: aStream
@@ -478,6 +475,46 @@ import: aStream
 									result scanFrom: parser]]]
 ! !
 
+Object subclass: #MethodCategory
+	instanceVariableNames: 'methods name klass'
+	package: 'Importer-Exporter'!
+
+!MethodCategory methodsFor: 'accessing'!
+
+klass
+	^klass
+!
+
+klass: aClass
+	klass := aClass
+!
+
+methods
+	^methods
+!
+
+methods: anArray
+	methods := anArray
+!
+
+name
+	^name
+!
+
+name: aString
+	name := aString
+! !
+
+!MethodCategory class methodsFor: 'not yet classified'!
+
+name: aString class: aClass methods: anArray
+	^self new
+		name: aString;
+		klass: aClass;
+		methods: anArray;
+		yourself
+! !
+
 InterfacingObject subclass: #PackageHandler
 	instanceVariableNames: ''
 	package: 'Importer-Exporter'!
@@ -496,6 +533,10 @@ commit: aPackage
 				(PluggableExporter newUsing: commitStrategy key) exportPackage: aPackage on: stream ].
 			self ajaxPutAt: commitStrategy value data: fileContents ]
 		displayingProgress: 'Committing package ', aPackage name
+!
+
+commitChannels
+	self subclassResponsibility
 ! !
 
 !PackageHandler methodsFor: 'private'!

+ 32 - 17
support/boot.js

@@ -93,7 +93,7 @@ function SmalltalkObject() {}
 function Smalltalk() {}
 inherits(Smalltalk, SmalltalkObject);
 
-var api = new Smalltalk;
+var api = new Smalltalk();
 var brikz = new Brikz(api);
 
 function RootBrik(brikz, st) {
@@ -101,7 +101,7 @@ function RootBrik(brikz, st) {
 	function SmalltalkNil() {}
 	inherits(SmalltalkNil, SmalltalkObject);
 
-	this.nil = new SmalltalkNil;
+	this.nil = new SmalltalkNil();
 
 	this.__init__ = function () {
 		st.wrapClassName("Object", "Kernel-Objects", SmalltalkObject, undefined, false);
@@ -134,12 +134,12 @@ function OrganizeBrik(brikz, st) {
 	};
 
 	this.setupClassOrganization = function (klass) {
-		klass.organization = new SmalltalkClassOrganizer;
+		klass.organization = new SmalltalkClassOrganizer();
 		klass.organization.theClass = klass;
 	};
 
 	this.setupPackageOrganization = function (pkg) {
-		pkg.organization = new SmalltalkPackageOrganizer;
+		pkg.organization = new SmalltalkPackageOrganizer();
 	};
 
 	this.addOrganizationElement = function (owner, element) {
@@ -188,7 +188,7 @@ function DNUBrik(brikz, st) {
 		};
 
 		return handler;
-	}
+	};
 
 	this.installHandlers = function (klass) {
 		for(var i=0; i<methods.length; i++) {
@@ -204,7 +204,7 @@ function ClassInitBrik(brikz, st) {
 	var nil = brikz.ensure("root").nil;
 
 	/* Initialize a class in its class hierarchy. Handle both classes and
-	 metaclasses. */
+	metaclasses. */
 
 	st.init = function(klass) {
 		st.initClass(klass);
@@ -227,8 +227,8 @@ function ClassInitBrik(brikz, st) {
 		var inheritedMethods = {};
 		deinstallAllMethods(klass);
 		for (superclass = superclass || klass.superclass;
-			 superclass && superclass !== nil;
-			 superclass = superclass.superclass) {
+			superclass && superclass !== nil;
+			superclass = superclass.superclass) {
 			for (var keys = Object.keys(superclass.methods), i = 0; i < keys.length; i++) {
 				inheritMethodIfAbsent(superclass.methods[keys[i]]);
 			}
@@ -778,16 +778,30 @@ function PrimitivesBrik(brikz, st) {
 
 }
 
+function PrepareRuntimeBrik(brikz, st) {
+
+	brikz.ensure("root");
+
+	function SmalltalkMethodContext(home, setup) {
+		this.construct.apply(this, arguments);
+	}
+
+	inherits(SmalltalkMethodContext, SmalltalkObject);
+
+	this.__init__ = function () {
+		st.wrapClassName("MethodContext", "Kernel-Methods", SmalltalkMethodContext, st.Object, false);
+	};
+
+	this.MethodContext = SmalltalkMethodContext;
+}
+
 function RuntimeBrik(brikz, st) {
 
 	brikz.ensure("selectorConversion");
+	brikz.ensure("prepRuntime");
 	var nil = brikz.ensure("root").nil;
 
-	function SmalltalkMethodContext(home, setup) {
-		this.homeContext = home;
-		this.setup       = setup || function() {};
-		this.pc          = 0;
-	}
+	var SmalltalkMethodContext = brikz.prepRuntime.MethodContext;
 
 // Fallbacks
 	SmalltalkMethodContext.prototype.locals = {};
@@ -795,10 +809,10 @@ function RuntimeBrik(brikz, st) {
 	SmalltalkMethodContext.prototype.selector = null;
 	SmalltalkMethodContext.prototype.lookupClass = null;
 
-	inherits(SmalltalkMethodContext, SmalltalkObject);
-
-	this.__init__ = function () {
-		st.wrapClassName("MethodContext", "Kernel-Methods", SmalltalkMethodContext, st.Object, false);
+	SmalltalkMethodContext.prototype.construct  = function (home, setup) {
+		this.homeContext = home;
+		this.setup       = setup || function() {};
+		this.pc          = 0;
 	};
 
 	SmalltalkMethodContext.prototype.fill = function(receiver, selector, locals, lookupClass) {
@@ -1046,6 +1060,7 @@ brikz.classes = ClassesBrik;
 brikz.methods = MethodsBrik;
 brikz.stInit = SmalltalkInitBrik;
 brikz.augments = AugmentsBrik;
+brikz.prepRuntime = PrepareRuntimeBrik;
 
 brikz.rebuild();