Kernel-Transcript.st 768 B

1234567891011121314151617181920212223242526272829303132333435
  1. Smalltalk createPackage: 'Kernel-Transcript'!
  2. Object subclass: #ConsoleTranscript
  3. instanceVariableNames: 'textarea'
  4. package: 'Kernel-Transcript'!
  5. !ConsoleTranscript commentStamp!
  6. I am a specific transcript emitting to the JavaScript console.
  7. If no other transcript is registered, I am the default.!
  8. !ConsoleTranscript methodsFor: 'actions'!
  9. open
  10. ! !
  11. !ConsoleTranscript methodsFor: 'printing'!
  12. clear
  13. "no op"
  14. !
  15. cr
  16. "no op"
  17. !
  18. show: anObject
  19. "Smalltalk objects should have no trouble displaying themselves on the Transcript; Javascript objects don't know how, so must be wrapped in a JSObectProxy."
  20. <console.log(String(_st(anObject)._asString()))>
  21. ! !
  22. !ConsoleTranscript class methodsFor: 'initialization'!
  23. initialize
  24. Transcript registerIfNone: self new
  25. ! !