123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- define(["smalltalk","nil","_st"], function(smalltalk,nil,_st){
- smalltalk.addPackage('Kernel-Transcript');
- smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
- smalltalk.ConsoleTranscript.comment="I am a specific transcript emitting to the JavaScript console.\x0a\x0aIf no other transcript is registered, I am the default.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "clear",
- category: 'printing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.ConsoleTranscript)})},
- args: [],
- source: "clear\x0a\x09\x22no op\x22",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ConsoleTranscript);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cr",
- category: 'printing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.ConsoleTranscript)})},
- args: [],
- source: "cr\x0a\x09\x22no op\x22",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ConsoleTranscript);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "open",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.ConsoleTranscript)})},
- args: [],
- source: "open",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ConsoleTranscript);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "show:",
- category: 'printing',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- console.log(String(_st(anObject)._asString()));
- return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},smalltalk.ConsoleTranscript)})},
- args: ["anObject"],
- source: "show: anObject\x0a\x22Smalltalk objects should have no trouble displaying themselves on the Transcript; Javascript objects don't know how, so must be wrapped in a JSObectProxy.\x22\x0a<console.log(String(_st(anObject)._asString()))>",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ConsoleTranscript);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initialize",
- category: 'initialization',
- fn: function (){
- var self=this;
- function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
- return smalltalk.withContext(function($ctx1) {
- _st($Transcript())._register_(self._new());
- return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ConsoleTranscript.klass)})},
- args: [],
- source: "initialize\x0a\x09Transcript register: self new",
- messageSends: ["register:", "new"],
- referencedClasses: ["Transcript"]
- }),
- smalltalk.ConsoleTranscript.klass);
- smalltalk.addClass('Transcript', smalltalk.Object, [], 'Kernel-Transcript');
- smalltalk.Transcript.comment="I am a facade for Transcript actions.\x0a\x0aI delegate actions to the currently registered transcript.\x0a\x0a## API\x0a\x0a Transcript \x0a show: 'hello world';\x0a cr;\x0a show: anObject.";
- smalltalk.Transcript.klass.iVarNames = ['current'];
- smalltalk.addMethod(
- smalltalk.method({
- selector: "clear",
- category: 'printing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._current())._clear();
- return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.Transcript.klass)})},
- args: [],
- source: "clear\x0a\x09self current clear",
- messageSends: ["clear", "current"],
- referencedClasses: []
- }),
- smalltalk.Transcript.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cr",
- category: 'printing',
- fn: function (){
- var self=this;
- function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
- return smalltalk.withContext(function($ctx1) {
- _st(self._current())._show_(_st($String())._cr());
- return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.Transcript.klass)})},
- args: [],
- source: "cr\x0a\x09self current show: String cr",
- messageSends: ["show:", "cr", "current"],
- referencedClasses: ["String"]
- }),
- smalltalk.Transcript.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "current",
- category: 'instance creation',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@current"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.Transcript.klass)})},
- args: [],
- source: "current\x0a\x09^current",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Transcript.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "inspect:",
- category: 'printing',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._show_(anObject);
- return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Transcript.klass)})},
- args: ["anObject"],
- source: "inspect: anObject\x0a\x09self show: anObject",
- messageSends: ["show:"],
- referencedClasses: []
- }),
- smalltalk.Transcript.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "new",
- category: 'instance creation',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._shouldNotImplement();
- return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.Transcript.klass)})},
- args: [],
- source: "new\x0a\x09self shouldNotImplement",
- messageSends: ["shouldNotImplement"],
- referencedClasses: []
- }),
- smalltalk.Transcript.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "open",
- category: 'instance creation',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._current())._open();
- return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.Transcript.klass)})},
- args: [],
- source: "open\x0a\x09self current open",
- messageSends: ["open", "current"],
- referencedClasses: []
- }),
- smalltalk.Transcript.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "register:",
- category: 'instance creation',
- fn: function (aTranscript){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@current"]=aTranscript;
- return self}, function($ctx1) {$ctx1.fill(self,"register:",{aTranscript:aTranscript},smalltalk.Transcript.klass)})},
- args: ["aTranscript"],
- source: "register: aTranscript\x0a\x09current := aTranscript",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Transcript.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "show:",
- category: 'printing',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._current())._show_(anObject);
- return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},smalltalk.Transcript.klass)})},
- args: ["anObject"],
- source: "show: anObject\x0a\x09self current show: anObject",
- messageSends: ["show:", "current"],
- referencedClasses: []
- }),
- smalltalk.Transcript.klass);
- });
|