1
0
Herbert Vojčík 7 лет назад
Родитель
Сommit
6024dc5713
2 измененных файлов с 13 добавлено и 5 удалено
  1. 12 4
      src/Kernel-Infrastructure.js
  2. 1 1
      src/Kernel-Infrastructure.st

+ 12 - 4
src/Kernel-Infrastructure.js

@@ -1570,7 +1570,7 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anObject"],
-source: "javaScriptDescriptor: anObject\x0a\x09| basicEval basicImports |\x0a\x0a\x09basicEval := (anObject at: 'innerEval' ifAbsent: [ nil asJavaScriptObject ]).\x0a\x09basicImports := (anObject at: 'imports' ifAbsent: [ #() ]).\x0a\x09basicTransport := (anObject at: 'transport' ifAbsent: []).\x0a\x09\x09\x09\x0a\x09self\x0a\x09\x09evalBlock: basicEval;\x0a\x09\x09imports: (self importsFromJson: basicImports)\x09\x09\x09",
+source: "javaScriptDescriptor: anObject\x0a\x09| basicEval basicImports |\x0a\x0a\x09basicEval := (anObject at: 'innerEval' ifAbsent: [ nil asJavaScriptObject ]).\x0a\x09basicImports := (anObject at: 'imports' ifAbsent: [ #() ]).\x0a\x09basicTransport := (anObject at: 'transport' ifAbsent: []).\x0a\x09\x09\x09\x0a\x09self\x0a\x09\x09evalBlock: basicEval;\x0a\x09\x09imports: (self importsFromJson: basicImports)",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["at:ifAbsent:", "asJavaScriptObject", "evalBlock:", "imports:", "importsFromJson:"]
@@ -2923,17 +2923,25 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv($self._packageDictionary())._at_put_(packageName,$recv($globals.Package)._new_(packageName));
+return $recv($self._packageDictionary())._at_ifAbsentPut_(packageName,(function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv($globals.Package)._new_(packageName);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"basicCreatePackage:",{packageName:packageName},$globals.SmalltalkImage)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["packageName"],
-source: "basicCreatePackage: packageName\x0a\x09\x22Create and bind a new bare package with given name and return it.\x22\x0a\x09^ self packageDictionary at: packageName put: (Package new: packageName)",
+source: "basicCreatePackage: packageName\x0a\x09\x22Create and bind a new bare package with given name and return it.\x22\x0a\x09^ self packageDictionary at: packageName ifAbsentPut: [ Package new: packageName ]",
 referencedClasses: ["Package"],
 //>>excludeEnd("ide");
-messageSends: ["at:put:", "packageDictionary", "new:"]
+messageSends: ["at:ifAbsentPut:", "packageDictionary", "new:"]
 }),
 $globals.SmalltalkImage);
 

+ 1 - 1
src/Kernel-Infrastructure.st

@@ -1001,7 +1001,7 @@ adoptPackageDictionary
 
 basicCreatePackage: packageName
 	"Create and bind a new bare package with given name and return it."
-	^ self packageDictionary at: packageName put: (Package new: packageName)
+	^ self packageDictionary at: packageName ifAbsentPut: [ Package new: packageName ]
 !
 
 basicParse: aString