瀏覽代碼

helios: fix transcript printing when the transcript is not displayed

Nicolas Petton 11 年之前
父節點
當前提交
252a69c99a
共有 3 個文件被更改,包括 17 次插入4 次删除
  1. 7 1
      js/Helios-Transcript.deploy.js
  2. 8 2
      js/Helios-Transcript.js
  3. 2 1
      st/Helios-Transcript.st

+ 7 - 1
js/Helios-Transcript.deploy.js

@@ -59,9 +59,15 @@ selector: "show:",
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@textarea"];
+if(($receiver = $1) == nil || $receiver == undefined){
+$1;
+} else {
 _st(_st(self["@textarea"])._asJQuery())._append_(_st(aString)._asString());
+};
 return self}, function($ctx1) {$ctx1.fill(self,"show:",{aString:aString},smalltalk.HLTranscript)})},
-messageSends: ["append:", "asString", "asJQuery"]}),
+messageSends: ["ifNotNil:", "append:", "asString", "asJQuery"]}),
 smalltalk.HLTranscript);
 
 smalltalk.addMethod(

+ 8 - 2
js/Helios-Transcript.js

@@ -81,11 +81,17 @@ category: 'actions',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@textarea"];
+if(($receiver = $1) == nil || $receiver == undefined){
+$1;
+} else {
 _st(_st(self["@textarea"])._asJQuery())._append_(_st(aString)._asString());
+};
 return self}, function($ctx1) {$ctx1.fill(self,"show:",{aString:aString},smalltalk.HLTranscript)})},
 args: ["aString"],
-source: "show: aString\x0a\x09textarea asJQuery append: aString asString",
-messageSends: ["append:", "asString", "asJQuery"],
+source: "show: aString\x0a\x09textarea ifNotNil: [\x0a \x09\x09textarea asJQuery append: aString asString ]",
+messageSends: ["ifNotNil:", "append:", "asString", "asJQuery"],
 referencedClasses: []
 }),
 smalltalk.HLTranscript);

+ 2 - 1
st/Helios-Transcript.st

@@ -23,7 +23,8 @@ clear
 !
 
 show: aString
-	textarea asJQuery append: aString asString
+	textarea ifNotNil: [
+ 		textarea asJQuery append: aString asString ]
 ! !
 
 !HLTranscript methodsFor: 'initialization'!