2
0
Просмотр исходного кода

Test printing a JS object that exists everywhere

I don't have access to the `window` object when running Amber on Node,
and probably in other places. The `console` object seems to be pretty
universal.
Kenneth Pullen 11 лет назад
Родитель
Сommit
03a0b9d7e0
3 измененных файлов с 4 добавлено и 4 удалено
  1. 1 1
      js/Kernel-Tests.deploy.js
  2. 2 2
      js/Kernel-Tests.js
  3. 1 1
      st/Kernel-Tests.st

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

@@ -1893,7 +1893,7 @@ return _st($Transcript())._show_("Hello console!");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
 _st(self)._shouldnt_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st($Transcript())._show_(window);
+return _st($Transcript())._show_(console);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
 _st($Transcript())._register_(originalTranscript);
 return self}, function($ctx1) {$ctx1.fill(self,"testShow",{originalTranscript:originalTranscript},smalltalk.ConsoleTranscriptTest)})},

+ 2 - 2
js/Kernel-Tests.js

@@ -2364,12 +2364,12 @@ return _st($Transcript())._show_("Hello console!");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
 _st(self)._shouldnt_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st($Transcript())._show_(window);
+return _st($Transcript())._show_(console);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
 _st($Transcript())._register_(originalTranscript);
 return self}, function($ctx1) {$ctx1.fill(self,"testShow",{originalTranscript:originalTranscript},smalltalk.ConsoleTranscriptTest)})},
 args: [],
-source: "testShow\x0a| originalTranscript |\x0aoriginalTranscript := Transcript current.\x0aTranscript register: ConsoleTranscript new.\x0a\x0aself shouldnt: [ Transcript show: 'Hello console!' ] raise: Error.\x0aself shouldnt: [ Transcript show: window ] raise: Error.\x0a\x0aTranscript register: originalTranscript.",
+source: "testShow\x0a| originalTranscript |\x0aoriginalTranscript := Transcript current.\x0aTranscript register: ConsoleTranscript new.\x0a\x0aself shouldnt: [ Transcript show: 'Hello console!' ] raise: Error.\x0aself shouldnt: [ Transcript show: console ] raise: Error.\x0a\x0aTranscript register: originalTranscript.",
 messageSends: ["current", "register:", "new", "shouldnt:raise:", "show:"],
 referencedClasses: ["Transcript", "ConsoleTranscript", "Error"]
 }),

+ 1 - 1
st/Kernel-Tests.st

@@ -902,7 +902,7 @@ originalTranscript := Transcript current.
 Transcript register: ConsoleTranscript new.
 
 self shouldnt: [ Transcript show: 'Hello console!!' ] raise: Error.
-self shouldnt: [ Transcript show: window ] raise: Error.
+self shouldnt: [ Transcript show: console ] raise: Error.
 
 Transcript register: originalTranscript.
 ! !