Browse Source

smalltalk.addMethod does not use explicit js selector.

It is implicit, computed from st selector.
There is compatibility prologue that accepts additional parameter.
Herbert Vojčík 11 years ago
parent
commit
058d10b9c9

+ 6 - 42
js/Importer-Exporter.deploy.js

@@ -1,7 +1,6 @@
 smalltalk.addPackage('Importer-Exporter');
 smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
 smalltalk.addMethod(
-"_nextChunk",
 smalltalk.method({
 selector: "nextChunk",
 fn: function () {
@@ -39,7 +38,6 @@ messageSends: ["writeStream", "whileTrue:", "ifTrue:", "ifTrue:ifFalse:", "next"
 smalltalk.ChunkParser);
 
 smalltalk.addMethod(
-"_stream_",
 smalltalk.method({
 selector: "stream:",
 fn: function (aStream) {
@@ -52,7 +50,6 @@ smalltalk.ChunkParser);
 
 
 smalltalk.addMethod(
-"_on_",
 smalltalk.method({
 selector: "on:",
 fn: function (aStream) {
@@ -68,7 +65,6 @@ smalltalk.ChunkParser.klass);
 
 smalltalk.addClass('Exporter', smalltalk.Object, [], 'Importer-Exporter');
 smalltalk.addMethod(
-"_classNameFor_",
 smalltalk.method({
 selector: "classNameFor:",
 fn: function (aClass) {
@@ -92,7 +88,6 @@ messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMeta
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportAll",
 smalltalk.method({
 selector: "exportAll",
 fn: function () {
@@ -114,7 +109,6 @@ messageSends: ["streamContents:", "do:", "nextPutAll:", "exportPackage:", "name"
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportClass_",
 smalltalk.method({
 selector: "exportClass:",
 fn: function (aClass) {
@@ -135,7 +129,6 @@ messageSends: ["streamContents:", "exportDefinitionOf:on:", "exportMethodsOf:on:
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportDefinitionOf_on_",
 smalltalk.method({
 selector: "exportDefinitionOf:on:",
 fn: function (aClass, aStream) {
@@ -174,7 +167,6 @@ messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedB
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportMetaDefinitionOf_on_",
 smalltalk.method({
 selector: "exportMetaDefinitionOf:on:",
 fn: function (aClass, aStream) {
@@ -202,18 +194,15 @@ messageSends: ["ifFalse:", "nextPutAll:", ",", "classNameFor:", "class", "do:sep
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportMethod_of_on_",
 smalltalk.method({
 selector: "exportMethod:of:on:",
-fn: function (aMethod, aClass, aStream) {
+fn: function (aMethod,aClass,aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._lf();
-_st($1)._nextPutAll_(_st(_st(_st(_st(aMethod)._selector())._asSelector())._asJavascript()).__comma(","));
-_st($1)._lf();
 _st($1)._nextPutAll_("smalltalk.method({");
 _st($1)._lf();
 _st($1)._nextPutAll_(_st(_st("selector: ").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
@@ -237,12 +226,11 @@ _st($3)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(aClass))
 _st($3)._nextPutAll_(");");
 _st($3)._lf();
 $4=_st($3)._lf();
-return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream},smalltalk.Exporter)});},
-messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream},smalltalk.Exporter)})},
+messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:"]}),
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportMethodsOf_on_",
 smalltalk.method({
 selector: "exportMethodsOf:on:",
 fn: function (aClass, aStream) {
@@ -265,7 +253,6 @@ messageSends: ["do:", "ifFalse:", "exportMethod:of:on:", "match:", "category", "
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportPackage_",
 smalltalk.method({
 selector: "exportPackage:",
 fn: function (packageName) {
@@ -292,7 +279,6 @@ messageSends: ["streamContents:", "packageAt:", "current", "exportPackageDefinit
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportPackageDefinitionOf_on_",
 smalltalk.method({
 selector: "exportPackageDefinitionOf:on:",
 fn: function (package_, aStream) {
@@ -308,7 +294,6 @@ messageSends: ["nextPutAll:", ",", "name", "lf"]}),
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportPackageExtensionsOf_on_",
 smalltalk.method({
 selector: "exportPackageExtensionsOf:on:",
 fn: function (package_, aStream) {
@@ -343,7 +328,6 @@ smalltalk.Exporter);
 
 smalltalk.addClass('ChunkExporter', smalltalk.Exporter, [], 'Importer-Exporter');
 smalltalk.addMethod(
-"_chunkEscape_",
 smalltalk.method({
 selector: "chunkEscape:",
 fn: function (aString) {
@@ -357,7 +341,6 @@ messageSends: ["trimBoth", "replace:with:"]}),
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_classNameFor_",
 smalltalk.method({
 selector: "classNameFor:",
 fn: function (aClass) {
@@ -381,7 +364,6 @@ messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMeta
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportDefinitionOf_on_",
 smalltalk.method({
 selector: "exportDefinitionOf:on:",
 fn: function (aClass, aStream) {
@@ -422,7 +404,6 @@ messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "tab", "
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportMetaDefinitionOf_on_",
 smalltalk.method({
 selector: "exportMetaDefinitionOf:on:",
 fn: function (aClass, aStream) {
@@ -453,7 +434,6 @@ messageSends: ["ifFalse:", "nextPutAll:", "classNameFor:", "class", "do:separate
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportMethod_of_on_",
 smalltalk.method({
 selector: "exportMethod:of:on:",
 fn: function (aMethod, aClass, aStream) {
@@ -471,7 +451,6 @@ messageSends: ["lf", "nextPutAll:", "chunkEscape:", "source"]}),
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportMethods_category_of_on_",
 smalltalk.method({
 selector: "exportMethods:category:of:on:",
 fn: function (methods, category, aClass, aStream) {
@@ -497,7 +476,6 @@ messageSends: ["nextPutAll:", ",", "classNameFor:", "do:", "exportMethod:of:on:"
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportMethodsOf_on_",
 smalltalk.method({
 selector: "exportMethodsOf:on:",
 fn: function (aClass, aStream) {
@@ -529,7 +507,6 @@ messageSends: ["new", "protocolsDo:", "ifFalse:", "at:put:", "match:", "do:", "a
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportPackageDefinitionOf_on_",
 smalltalk.method({
 selector: "exportPackageDefinitionOf:on:",
 fn: function (package_, aStream) {
@@ -544,7 +521,6 @@ messageSends: ["nextPutAll:", ",", "name", "lf"]}),
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportPackageExtensionsOf_on_",
 smalltalk.method({
 selector: "exportPackageExtensionsOf:on:",
 fn: function (package_, aStream) {
@@ -589,7 +565,6 @@ smalltalk.ChunkExporter);
 
 smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Importer-Exporter');
 smalltalk.addMethod(
-"_exportDefinitionOf_on_",
 smalltalk.method({
 selector: "exportDefinitionOf:on:",
 fn: function (aClass, aStream) {
@@ -618,18 +593,15 @@ messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedB
 smalltalk.StrippedExporter);
 
 smalltalk.addMethod(
-"_exportMethod_of_on_",
 smalltalk.method({
 selector: "exportMethod:of:on:",
-fn: function (aMethod, aClass, aStream) {
+fn: function (aMethod,aClass,aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._lf();
-_st($1)._nextPutAll_(_st(_st(_st(_st(aMethod)._selector())._asSelector())._asJavascript()).__comma(","));
-_st($1)._lf();
 _st($1)._nextPutAll_("smalltalk.method({");
 _st($1)._lf();
 _st($1)._nextPutAll_(_st(_st("selector: ").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
@@ -643,15 +615,14 @@ _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(aClass))
 _st($1)._nextPutAll_(");");
 _st($1)._lf();
 $2=_st($1)._lf();
-return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream},smalltalk.StrippedExporter)});},
-messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "compiledSource", "fn", "messageSends", "classNameFor:"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream},smalltalk.StrippedExporter)})},
+messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "compiledSource", "fn", "messageSends", "classNameFor:"]}),
 smalltalk.StrippedExporter);
 
 
 
 smalltalk.addClass('Importer', smalltalk.Object, [], 'Importer-Exporter');
 smalltalk.addMethod(
-"_import_",
 smalltalk.method({
 selector: "import:",
 fn: function (aStream) {
@@ -693,7 +664,6 @@ smalltalk.Importer);
 
 smalltalk.addClass('PackageHandler', smalltalk.Object, [], 'Importer-Exporter');
 smalltalk.addMethod(
-"_ajaxPutAt_data_",
 smalltalk.method({
 selector: "ajaxPutAt:data:",
 fn: function (aURL, aString) {
@@ -708,7 +678,6 @@ messageSends: ["ajax:options:", "->", "error:", ",", "responseText"]}),
 smalltalk.PackageHandler);
 
 smalltalk.addMethod(
-"_commit_",
 smalltalk.method({
 selector: "commit:",
 fn: function (aPackage) {
@@ -729,7 +698,6 @@ messageSends: ["do:", "exportPackage:", "name", "new", "key", "ajaxPutAt:data:",
 smalltalk.PackageHandler);
 
 smalltalk.addMethod(
-"_loadPackage_prefix_",
 smalltalk.method({
 selector: "loadPackage:prefix:",
 fn: function (packageName, aString) {
@@ -753,7 +721,6 @@ messageSends: [",", "ajax:options:", "->", "ifTrue:", "setupPackageNamed:prefix:
 smalltalk.PackageHandler);
 
 smalltalk.addMethod(
-"_loadPackages_prefix_",
 smalltalk.method({
 selector: "loadPackages:prefix:",
 fn: function (aCollection, aString) {
@@ -768,7 +735,6 @@ messageSends: ["do:", "loadPackage:prefix:"]}),
 smalltalk.PackageHandler);
 
 smalltalk.addMethod(
-"_setupPackageNamed_prefix_",
 smalltalk.method({
 selector: "setupPackageNamed:prefix:",
 fn: function (packageName, aString) {
@@ -786,7 +752,6 @@ smalltalk.PackageHandler);
 
 
 smalltalk.addMethod(
-"_loadPackages_prefix_",
 smalltalk.method({
 selector: "loadPackages:prefix:",
 fn: function (aCollection, aString) {
@@ -801,7 +766,6 @@ smalltalk.PackageHandler.klass);
 
 
 smalltalk.addMethod(
-"_commit",
 smalltalk.method({
 selector: "commit",
 fn: function () {

+ 8 - 44
js/Importer-Exporter.js

@@ -1,7 +1,6 @@
 smalltalk.addPackage('Importer-Exporter');
 smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
 smalltalk.addMethod(
-"_nextChunk",
 smalltalk.method({
 selector: "nextChunk",
 category: 'reading',
@@ -44,7 +43,6 @@ referencedClasses: []
 smalltalk.ChunkParser);
 
 smalltalk.addMethod(
-"_stream_",
 smalltalk.method({
 selector: "stream:",
 category: 'accessing',
@@ -62,7 +60,6 @@ smalltalk.ChunkParser);
 
 
 smalltalk.addMethod(
-"_on_",
 smalltalk.method({
 selector: "on:",
 category: 'not yet classified',
@@ -83,7 +80,6 @@ smalltalk.ChunkParser.klass);
 
 smalltalk.addClass('Exporter', smalltalk.Object, [], 'Importer-Exporter');
 smalltalk.addMethod(
-"_classNameFor_",
 smalltalk.method({
 selector: "classNameFor:",
 category: 'private',
@@ -112,7 +108,6 @@ referencedClasses: []
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportAll",
 smalltalk.method({
 selector: "exportAll",
 category: 'fileOut',
@@ -139,7 +134,6 @@ referencedClasses: ["Smalltalk", "String"]
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportClass_",
 smalltalk.method({
 selector: "exportClass:",
 category: 'fileOut',
@@ -165,7 +159,6 @@ referencedClasses: ["String"]
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportDefinitionOf_on_",
 smalltalk.method({
 selector: "exportDefinitionOf:on:",
 category: 'private',
@@ -209,7 +202,6 @@ referencedClasses: []
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportMetaDefinitionOf_on_",
 smalltalk.method({
 selector: "exportMetaDefinitionOf:on:",
 category: 'private',
@@ -242,19 +234,16 @@ referencedClasses: ["String"]
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportMethod_of_on_",
 smalltalk.method({
 selector: "exportMethod:of:on:",
 category: 'private',
-fn: function (aMethod, aClass, aStream) {
+fn: function (aMethod,aClass,aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._lf();
-_st($1)._nextPutAll_(_st(_st(_st(_st(aMethod)._selector())._asSelector())._asJavascript()).__comma(","));
-_st($1)._lf();
 _st($1)._nextPutAll_("smalltalk.method({");
 _st($1)._lf();
 _st($1)._nextPutAll_(_st(_st("selector: ").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
@@ -278,16 +267,15 @@ _st($3)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(aClass))
 _st($3)._nextPutAll_(");");
 _st($3)._lf();
 $4=_st($3)._lf();
-return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream},smalltalk.Exporter)});},
+return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream},smalltalk.Exporter)})},
 args: ["aMethod", "aClass", "aStream"],
-source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'category: ''', aMethod category, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript.\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
-messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:"],
+source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09\x22nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x22\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'category: ''', aMethod category, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript.\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
+messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:"],
 referencedClasses: []
 }),
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportMethodsOf_on_",
 smalltalk.method({
 selector: "exportMethodsOf:on:",
 category: 'private',
@@ -315,7 +303,6 @@ referencedClasses: []
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportPackage_",
 smalltalk.method({
 selector: "exportPackage:",
 category: 'fileOut',
@@ -347,7 +334,6 @@ referencedClasses: ["Smalltalk", "String"]
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportPackageDefinitionOf_on_",
 smalltalk.method({
 selector: "exportPackageDefinitionOf:on:",
 category: 'private',
@@ -368,7 +354,6 @@ referencedClasses: []
 smalltalk.Exporter);
 
 smalltalk.addMethod(
-"_exportPackageExtensionsOf_on_",
 smalltalk.method({
 selector: "exportPackageExtensionsOf:on:",
 category: 'private',
@@ -408,7 +393,6 @@ smalltalk.Exporter);
 
 smalltalk.addClass('ChunkExporter', smalltalk.Exporter, [], 'Importer-Exporter');
 smalltalk.addMethod(
-"_chunkEscape_",
 smalltalk.method({
 selector: "chunkEscape:",
 category: 'not yet classified',
@@ -427,7 +411,6 @@ referencedClasses: []
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_classNameFor_",
 smalltalk.method({
 selector: "classNameFor:",
 category: 'not yet classified',
@@ -456,7 +439,6 @@ referencedClasses: []
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportDefinitionOf_on_",
 smalltalk.method({
 selector: "exportDefinitionOf:on:",
 category: 'not yet classified',
@@ -502,7 +484,6 @@ referencedClasses: []
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportMetaDefinitionOf_on_",
 smalltalk.method({
 selector: "exportMetaDefinitionOf:on:",
 category: 'not yet classified',
@@ -538,7 +519,6 @@ referencedClasses: []
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportMethod_of_on_",
 smalltalk.method({
 selector: "exportMethod:of:on:",
 category: 'not yet classified',
@@ -561,7 +541,6 @@ referencedClasses: []
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportMethods_category_of_on_",
 smalltalk.method({
 selector: "exportMethods:category:of:on:",
 category: 'not yet classified',
@@ -592,7 +571,6 @@ referencedClasses: []
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportMethodsOf_on_",
 smalltalk.method({
 selector: "exportMethodsOf:on:",
 category: 'not yet classified',
@@ -629,7 +607,6 @@ referencedClasses: ["Dictionary"]
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportPackageDefinitionOf_on_",
 smalltalk.method({
 selector: "exportPackageDefinitionOf:on:",
 category: 'not yet classified',
@@ -649,7 +626,6 @@ referencedClasses: []
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(
-"_exportPackageExtensionsOf_on_",
 smalltalk.method({
 selector: "exportPackageExtensionsOf:on:",
 category: 'not yet classified',
@@ -699,7 +675,6 @@ smalltalk.ChunkExporter);
 
 smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Importer-Exporter');
 smalltalk.addMethod(
-"_exportDefinitionOf_on_",
 smalltalk.method({
 selector: "exportDefinitionOf:on:",
 category: 'private',
@@ -733,19 +708,16 @@ referencedClasses: []
 smalltalk.StrippedExporter);
 
 smalltalk.addMethod(
-"_exportMethod_of_on_",
 smalltalk.method({
 selector: "exportMethod:of:on:",
 category: 'private',
-fn: function (aMethod, aClass, aStream) {
+fn: function (aMethod,aClass,aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._lf();
-_st($1)._nextPutAll_(_st(_st(_st(_st(aMethod)._selector())._asSelector())._asJavascript()).__comma(","));
-_st($1)._lf();
 _st($1)._nextPutAll_("smalltalk.method({");
 _st($1)._lf();
 _st($1)._nextPutAll_(_st(_st("selector: ").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
@@ -759,10 +731,10 @@ _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(aClass))
 _st($1)._nextPutAll_(");");
 _st($1)._lf();
 $2=_st($1)._lf();
-return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream},smalltalk.StrippedExporter)});},
+return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream},smalltalk.StrippedExporter)})},
 args: ["aMethod", "aClass", "aStream"],
-source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
-messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "compiledSource", "fn", "messageSends", "classNameFor:"],
+source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09\x22nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x22\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
+messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "compiledSource", "fn", "messageSends", "classNameFor:"],
 referencedClasses: []
 }),
 smalltalk.StrippedExporter);
@@ -771,7 +743,6 @@ smalltalk.StrippedExporter);
 
 smalltalk.addClass('Importer', smalltalk.Object, [], 'Importer-Exporter');
 smalltalk.addMethod(
-"_import_",
 smalltalk.method({
 selector: "import:",
 category: 'fileIn',
@@ -818,7 +789,6 @@ smalltalk.Importer);
 
 smalltalk.addClass('PackageHandler', smalltalk.Object, [], 'Importer-Exporter');
 smalltalk.addMethod(
-"_ajaxPutAt_data_",
 smalltalk.method({
 selector: "ajaxPutAt:data:",
 category: 'private',
@@ -838,7 +808,6 @@ referencedClasses: []
 smalltalk.PackageHandler);
 
 smalltalk.addMethod(
-"_commit_",
 smalltalk.method({
 selector: "commit:",
 category: 'committing',
@@ -864,7 +833,6 @@ referencedClasses: ["Exporter", "StrippedExporter", "ChunkExporter"]
 smalltalk.PackageHandler);
 
 smalltalk.addMethod(
-"_loadPackage_prefix_",
 smalltalk.method({
 selector: "loadPackage:prefix:",
 category: 'loading',
@@ -893,7 +861,6 @@ referencedClasses: []
 smalltalk.PackageHandler);
 
 smalltalk.addMethod(
-"_loadPackages_prefix_",
 smalltalk.method({
 selector: "loadPackages:prefix:",
 category: 'loading',
@@ -913,7 +880,6 @@ referencedClasses: []
 smalltalk.PackageHandler);
 
 smalltalk.addMethod(
-"_setupPackageNamed_prefix_",
 smalltalk.method({
 selector: "setupPackageNamed:prefix:",
 category: 'private',
@@ -936,7 +902,6 @@ smalltalk.PackageHandler);
 
 
 smalltalk.addMethod(
-"_loadPackages_prefix_",
 smalltalk.method({
 selector: "loadPackages:prefix:",
 category: 'not yet classified',
@@ -956,7 +921,6 @@ smalltalk.PackageHandler.klass);
 
 
 smalltalk.addMethod(
-"_commit",
 smalltalk.method({
 selector: "commit",
 category: '*Importer-Exporter',

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

@@ -133,7 +133,7 @@ selector: "basicAddCompiledMethod:",
 fn: function (aMethod){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
+smalltalk.addMethod(aMethod, self);
 return self}, function($ctx1) {$ctx1.fill(self,"basicAddCompiledMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
 messageSends: []}),
 smalltalk.Behavior);

+ 2 - 2
js/Kernel-Classes.js

@@ -160,10 +160,10 @@ category: 'private',
 fn: function (aMethod){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
+smalltalk.addMethod(aMethod, self);
 return self}, function($ctx1) {$ctx1.fill(self,"basicAddCompiledMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
 args: ["aMethod"],
-source: "basicAddCompiledMethod: aMethod\x0a\x09<smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self)>",
+source: "basicAddCompiledMethod: aMethod\x0a\x09<smalltalk.addMethod(aMethod, self)>",
 messageSends: [],
 referencedClasses: []
 }),

+ 19 - 2
js/boot.js

@@ -466,8 +466,25 @@ function Smalltalk() {
      * Add/remove a method to/from a class 
      */
 
-	st.addMethod = function(jsSelector, method, klass) {
-		method.jsSelector = jsSelector;
+	st.addMethod = function(method_exJsSelector, klass_exMethod, exKlass) {
+        if (typeof method_exJsSelector === "string") { //legacy
+            if (method_exJsSelector !== st.selector(klass_exMethod.selector)) {
+                console.log("DISCREPANCY: arg, in_method");
+                console.log(method_exJsSelector);
+                console.log(st.selector(klass_exMethod.selector));
+                klass_exMethod.jsSelector = method_exJsSelector;
+            }
+            return new_addMethod(klass_exMethod, exKlass);
+        }
+
+        return new_addMethod(method_exJsSelector, klass_exMethod);
+    }
+
+    // later, st.addMethod can be this:
+    function new_addMethod(method, klass) {
+        if (!(method.jsSelector)) {
+            method.jsSelector = st.selector(method.selector);
+        }
 		installMethod(method, klass);
 		klass.methods[method.selector] = method;
 		method.methodClass = klass;

+ 2 - 2
st/Importer-Exporter.st

@@ -127,7 +127,7 @@ exportMetaDefinitionOf: aClass on: aStream
 exportMethod: aMethod of: aClass on: aStream
 	aStream
 		nextPutAll: 'smalltalk.addMethod(';lf;
-		nextPutAll: aMethod selector asSelector asJavascript, ',';lf;
+		"nextPutAll: aMethod selector asSelector asJavascript, ',';lf;"
 		nextPutAll: 'smalltalk.method({';lf;
 		nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;
 		nextPutAll: 'category: ''', aMethod category, ''',';lf;
@@ -310,7 +310,7 @@ exportDefinitionOf: aClass on: aStream
 exportMethod: aMethod of: aClass on: aStream
 	aStream
 		nextPutAll: 'smalltalk.addMethod(';lf;
-		nextPutAll: aMethod selector asSelector asJavascript, ',';lf;
+		"nextPutAll: aMethod selector asSelector asJavascript, ',';lf;"
 		nextPutAll: 'smalltalk.method({';lf;
 		nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;
 		nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;

+ 1 - 1
st/Kernel-Classes.st

@@ -244,7 +244,7 @@ new
 !Behavior methodsFor: 'private'!
 
 basicAddCompiledMethod: aMethod
-	<smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self)>
+	<smalltalk.addMethod(aMethod, self)>
 !
 
 basicRemoveCompiledMethod: aMethod