Parcourir la source

Fix for Package committing

Nicolas Petton il y a 11 ans
Parent
commit
be7d7988d9
3 fichiers modifiés avec 13 ajouts et 27 suppressions
  1. 2 8
      js/Importer-Exporter.deploy.js
  2. 3 9
      js/Importer-Exporter.js
  3. 8 10
      st/Importer-Exporter.st

+ 2 - 8
js/Importer-Exporter.deploy.js

@@ -717,21 +717,15 @@ function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?ni
 function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
 function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=aPackage;
-if(($receiver = $1) == nil || $receiver == undefined){
-$1;
-} else {
 _st([_st($Exporter()).__minus_gt(_st(_st(_st(_st(aPackage)._commitPathJs()).__comma("/")).__comma(_st(aPackage)._name())).__comma(".js")),_st($StrippedExporter()).__minus_gt(_st(_st(_st(_st(aPackage)._commitPathJs()).__comma("/")).__comma(_st(aPackage)._name())).__comma(".deploy.js")),_st($ChunkExporter()).__minus_gt(_st(_st(_st(_st(aPackage)._commitPathSt()).__comma("/")).__comma(_st(aPackage)._name())).__comma(".st"))])._do_((function(commitStrategy){
 var fileContents;
 return smalltalk.withContext(function($ctx2) {
-fileContents=_st(_st(_st(commitStrategy)._key())._new())._exportPackage_(aPackage);
+fileContents=_st(_st(_st(commitStrategy)._key())._new())._exportPackage_(_st(aPackage)._name());
 fileContents;
 return _st(self)._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
 }, function($ctx2) {$ctx2.fillBlock({commitStrategy:commitStrategy,fileContents:fileContents},$ctx1)})}));
-};
 return self}, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},smalltalk.PackageHandler)});},
-messageSends: ["ifNotNil:", "do:", "exportPackage:", "new", "key", "ajaxPutAt:data:", "value", "->", ",", "name", "commitPathJs", "commitPathSt"]}),
+messageSends: ["do:", "exportPackage:", "name", "new", "key", "ajaxPutAt:data:", "value", "->", ",", "commitPathJs", "commitPathSt"]}),
 smalltalk.PackageHandler);
 
 smalltalk.addMethod(

+ 3 - 9
js/Importer-Exporter.js

@@ -848,23 +848,17 @@ function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?ni
 function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
 function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=aPackage;
-if(($receiver = $1) == nil || $receiver == undefined){
-$1;
-} else {
 _st([_st($Exporter()).__minus_gt(_st(_st(_st(_st(aPackage)._commitPathJs()).__comma("/")).__comma(_st(aPackage)._name())).__comma(".js")),_st($StrippedExporter()).__minus_gt(_st(_st(_st(_st(aPackage)._commitPathJs()).__comma("/")).__comma(_st(aPackage)._name())).__comma(".deploy.js")),_st($ChunkExporter()).__minus_gt(_st(_st(_st(_st(aPackage)._commitPathSt()).__comma("/")).__comma(_st(aPackage)._name())).__comma(".st"))])._do_((function(commitStrategy){
 var fileContents;
 return smalltalk.withContext(function($ctx2) {
-fileContents=_st(_st(_st(commitStrategy)._key())._new())._exportPackage_(aPackage);
+fileContents=_st(_st(_st(commitStrategy)._key())._new())._exportPackage_(_st(aPackage)._name());
 fileContents;
 return _st(self)._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
 }, function($ctx2) {$ctx2.fillBlock({commitStrategy:commitStrategy,fileContents:fileContents},$ctx1)})}));
-};
 return self}, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},smalltalk.PackageHandler)});},
 args: ["aPackage"],
-source: "commit: aPackage\x0a\x09aPackage ifNotNil: [\x0a\x09\x09{ \x0a\x09\x09\x09Exporter -> (aPackage commitPathJs, '/', aPackage name, '.js').\x0a\x09\x09\x09StrippedExporter -> (aPackage commitPathJs, '/', aPackage name, '.deploy.js').\x0a\x09\x09\x09ChunkExporter -> (aPackage commitPathSt, '/', aPackage name, '.st')\x0a\x09\x09} \x0a\x09\x09\x09do: [ :commitStrategy|| fileContents |\x0a\x09\x09\x09\x09fileContents := (commitStrategy key new exportPackage: aPackage).\x0a\x09\x09\x09\x09self ajaxPutAt: commitStrategy value data: fileContents ]\x0a\x09]",
-messageSends: ["ifNotNil:", "do:", "exportPackage:", "new", "key", "ajaxPutAt:data:", "value", "->", ",", "name", "commitPathJs", "commitPathSt"],
+source: "commit: aPackage\x0a\x09{ \x0a\x09\x09Exporter -> (aPackage commitPathJs, '/', aPackage name, '.js').\x0a\x09\x09StrippedExporter -> (aPackage commitPathJs, '/', aPackage name, '.deploy.js').\x0a\x09\x09ChunkExporter -> (aPackage commitPathSt, '/', aPackage name, '.st')\x0a\x09} \x0a\x09\x09do: [ :commitStrategy|| fileContents |\x0a\x09\x09\x09fileContents := (commitStrategy key new exportPackage: aPackage name).\x0a\x09\x09\x09self ajaxPutAt: commitStrategy value data: fileContents ]",
+messageSends: ["do:", "exportPackage:", "name", "new", "key", "ajaxPutAt:data:", "value", "->", ",", "commitPathJs", "commitPathSt"],
 referencedClasses: ["Exporter", "StrippedExporter", "ChunkExporter"]
 }),
 smalltalk.PackageHandler);

+ 8 - 10
st/Importer-Exporter.st

@@ -349,16 +349,14 @@ Object subclass: #PackageHandler
 !PackageHandler methodsFor: 'committing'!
 
 commit: aPackage
-	aPackage ifNotNil: [
-		{ 
-			Exporter -> (aPackage commitPathJs, '/', aPackage name, '.js').
-			StrippedExporter -> (aPackage commitPathJs, '/', aPackage name, '.deploy.js').
-			ChunkExporter -> (aPackage commitPathSt, '/', aPackage name, '.st')
-		} 
-			do: [ :commitStrategy|| fileContents |
-				fileContents := (commitStrategy key new exportPackage: aPackage).
-				self ajaxPutAt: commitStrategy value data: fileContents ]
-	]
+	{ 
+		Exporter -> (aPackage commitPathJs, '/', aPackage name, '.js').
+		StrippedExporter -> (aPackage commitPathJs, '/', aPackage name, '.deploy.js').
+		ChunkExporter -> (aPackage commitPathSt, '/', aPackage name, '.st')
+	} 
+		do: [ :commitStrategy|| fileContents |
+			fileContents := (commitStrategy key new exportPackage: aPackage name).
+			self ajaxPutAt: commitStrategy value data: fileContents ]
 ! !
 
 !PackageHandler methodsFor: 'loading'!