Kernel-Exceptions.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. smalltalk.addPackage('Kernel-Exceptions', {});
  2. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
  3. smalltalk.Error.comment="From the ANSI standard:\x0a\x0aThis protocol describes the behavior of instances of class `Error`. \x0aThese are used to represent error conditions that prevent the normal continuation of processing. \x0aActual error exceptions used by an application may be subclasses of this class.\x0aAs `Error` is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner."
  4. smalltalk.addMethod(
  5. "_context",
  6. smalltalk.method({
  7. selector: "context",
  8. category: 'accessing',
  9. fn: function (){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) { return self.context;
  12. return self}, function($ctx1) {$ctx1.fill(self,"context",{}, smalltalk.Error)})},
  13. args: [],
  14. source: "context\x0a\x09<return self.context>",
  15. messageSends: [],
  16. referencedClasses: []
  17. }),
  18. smalltalk.Error);
  19. smalltalk.addMethod(
  20. "_initialize",
  21. smalltalk.method({
  22. selector: "initialize",
  23. category: 'initialization',
  24. fn: function (){
  25. var self=this;
  26. return smalltalk.withContext(function($ctx1) { _st(self)._messageText_(_st("Errorclass: ").__comma(_st(_st(self)._class())._name()));
  27. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Error)})},
  28. args: [],
  29. source: "initialize\x0a\x09self messageText: 'Errorclass: ', (self class name).",
  30. messageSends: ["messageText:", ",", "name", "class"],
  31. referencedClasses: []
  32. }),
  33. smalltalk.Error);
  34. smalltalk.addMethod(
  35. "_isSmalltalkError",
  36. smalltalk.method({
  37. selector: "isSmalltalkError",
  38. category: 'testing',
  39. fn: function (){
  40. var self=this;
  41. return smalltalk.withContext(function($ctx1) { return self.smalltalkError === true;
  42. return self}, function($ctx1) {$ctx1.fill(self,"isSmalltalkError",{}, smalltalk.Error)})},
  43. args: [],
  44. source: "isSmalltalkError\x0a\x09<return self.smalltalkError === true>",
  45. messageSends: [],
  46. referencedClasses: []
  47. }),
  48. smalltalk.Error);
  49. smalltalk.addMethod(
  50. "_jsStack",
  51. smalltalk.method({
  52. selector: "jsStack",
  53. category: 'accessing',
  54. fn: function (){
  55. var self=this;
  56. return smalltalk.withContext(function($ctx1) { return self.stack;
  57. return self}, function($ctx1) {$ctx1.fill(self,"jsStack",{}, smalltalk.Error)})},
  58. args: [],
  59. source: "jsStack\x0a\x09<return self.stack>",
  60. messageSends: [],
  61. referencedClasses: []
  62. }),
  63. smalltalk.Error);
  64. smalltalk.addMethod(
  65. "_messageText",
  66. smalltalk.method({
  67. selector: "messageText",
  68. category: 'accessing',
  69. fn: function (){
  70. var self=this;
  71. return smalltalk.withContext(function($ctx1) { var $1;
  72. $1=self["@messageText"];
  73. return $1;
  74. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.Error)})},
  75. args: [],
  76. source: "messageText\x0a\x09^messageText",
  77. messageSends: [],
  78. referencedClasses: []
  79. }),
  80. smalltalk.Error);
  81. smalltalk.addMethod(
  82. "_messageText_",
  83. smalltalk.method({
  84. selector: "messageText:",
  85. category: 'accessing',
  86. fn: function (aString){
  87. var self=this;
  88. return smalltalk.withContext(function($ctx1) { self["@messageText"]=aString;
  89. return self}, function($ctx1) {$ctx1.fill(self,"messageText:",{aString:aString}, smalltalk.Error)})},
  90. args: ["aString"],
  91. source: "messageText: aString\x0a\x09messageText := aString",
  92. messageSends: [],
  93. referencedClasses: []
  94. }),
  95. smalltalk.Error);
  96. smalltalk.addMethod(
  97. "_signal",
  98. smalltalk.method({
  99. selector: "signal",
  100. category: 'signaling',
  101. fn: function (){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) { self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
  104. return self}, function($ctx1) {$ctx1.fill(self,"signal",{}, smalltalk.Error)})},
  105. args: [],
  106. source: "signal\x0a\x09<self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self)>",
  107. messageSends: [],
  108. referencedClasses: []
  109. }),
  110. smalltalk.Error);
  111. smalltalk.addMethod(
  112. "_signal_",
  113. smalltalk.method({
  114. selector: "signal:",
  115. category: 'signaling',
  116. fn: function (aString){
  117. var self=this;
  118. return smalltalk.withContext(function($ctx1) { _st(self)._messageText_(aString);
  119. _st(self)._signal();
  120. return self}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString}, smalltalk.Error)})},
  121. args: ["aString"],
  122. source: "signal: aString\x0a\x09self messageText: aString.\x0a\x09self signal",
  123. messageSends: ["messageText:", "signal"],
  124. referencedClasses: []
  125. }),
  126. smalltalk.Error);
  127. smalltalk.addMethod(
  128. "_signal",
  129. smalltalk.method({
  130. selector: "signal",
  131. category: 'instance creation',
  132. fn: function (){
  133. var self=this;
  134. return smalltalk.withContext(function($ctx1) { var $1;
  135. $1=_st(_st(self)._new())._signal();
  136. return $1;
  137. }, function($ctx1) {$ctx1.fill(self,"signal",{}, smalltalk.Error.klass)})},
  138. args: [],
  139. source: "signal\x0a\x09^self new signal",
  140. messageSends: ["signal", "new"],
  141. referencedClasses: []
  142. }),
  143. smalltalk.Error.klass);
  144. smalltalk.addMethod(
  145. "_signal_",
  146. smalltalk.method({
  147. selector: "signal:",
  148. category: 'instance creation',
  149. fn: function (aString){
  150. var self=this;
  151. return smalltalk.withContext(function($ctx1) { var $1;
  152. $1=_st(_st(self)._new())._signal_(aString);
  153. return $1;
  154. }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString}, smalltalk.Error.klass)})},
  155. args: ["aString"],
  156. source: "signal: aString\x0a\x09 ^self new\x0a\x09\x09signal: aString",
  157. messageSends: ["signal:", "new"],
  158. referencedClasses: []
  159. }),
  160. smalltalk.Error.klass);
  161. smalltalk.addClass('JavaScriptException', smalltalk.Error, ['exception'], 'Kernel-Exceptions');
  162. smalltalk.JavaScriptException.comment="A JavaScriptException is thrown when a non-Smalltalk exception occurs while in the Smalltalk stack.\x0aSee `boot.js` `inContext()` and `BlockClosure >> on:do:`"
  163. smalltalk.addMethod(
  164. "_context_",
  165. smalltalk.method({
  166. selector: "context:",
  167. category: 'accessing',
  168. fn: function (aMethodContext){
  169. var self=this;
  170. return smalltalk.withContext(function($ctx1) { self.context = aMethodContext;
  171. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext}, smalltalk.JavaScriptException)})},
  172. args: ["aMethodContext"],
  173. source: "context: aMethodContext\x0a\x09\x22Set the context from the outside.\x0a See boot.js `inContext()` exception handling\x22\x0a \x0a <self.context = aMethodContext>",
  174. messageSends: [],
  175. referencedClasses: []
  176. }),
  177. smalltalk.JavaScriptException);
  178. smalltalk.addMethod(
  179. "_exception",
  180. smalltalk.method({
  181. selector: "exception",
  182. category: 'accessing',
  183. fn: function (){
  184. var self=this;
  185. return smalltalk.withContext(function($ctx1) { var $1;
  186. $1=self["@exception"];
  187. return $1;
  188. }, function($ctx1) {$ctx1.fill(self,"exception",{}, smalltalk.JavaScriptException)})},
  189. args: [],
  190. source: "exception\x0a\x09^ exception",
  191. messageSends: [],
  192. referencedClasses: []
  193. }),
  194. smalltalk.JavaScriptException);
  195. smalltalk.addMethod(
  196. "_exception_",
  197. smalltalk.method({
  198. selector: "exception:",
  199. category: 'accessing',
  200. fn: function (anException){
  201. var self=this;
  202. return smalltalk.withContext(function($ctx1) { self["@exception"]=anException;
  203. return self}, function($ctx1) {$ctx1.fill(self,"exception:",{anException:anException}, smalltalk.JavaScriptException)})},
  204. args: ["anException"],
  205. source: "exception: anException\x0a\x09exception := anException",
  206. messageSends: [],
  207. referencedClasses: []
  208. }),
  209. smalltalk.JavaScriptException);
  210. smalltalk.addMethod(
  211. "_messageText",
  212. smalltalk.method({
  213. selector: "messageText",
  214. category: 'accessing',
  215. fn: function (){
  216. var self=this;
  217. return smalltalk.withContext(function($ctx1) { return 'JavaScript exception: ' + self["@exception"].toString();
  218. return self}, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.JavaScriptException)})},
  219. args: [],
  220. source: "messageText\x0a\x09<return 'JavaScript exception: ' + self[\x22@exception\x22].toString()>",
  221. messageSends: [],
  222. referencedClasses: []
  223. }),
  224. smalltalk.JavaScriptException);
  225. smalltalk.addMethod(
  226. "_on_",
  227. smalltalk.method({
  228. selector: "on:",
  229. category: 'instance creation',
  230. fn: function (anException){
  231. var self=this;
  232. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  233. $2=_st(self)._new();
  234. _st($2)._exception_(anException);
  235. $3=_st($2)._yourself();
  236. $1=$3;
  237. return $1;
  238. }, function($ctx1) {$ctx1.fill(self,"on:",{anException:anException}, smalltalk.JavaScriptException.klass)})},
  239. args: ["anException"],
  240. source: "on: anException\x0a\x09^ self new\x0a \x09exception: anException;\x0a yourself",
  241. messageSends: ["exception:", "new", "yourself"],
  242. referencedClasses: []
  243. }),
  244. smalltalk.JavaScriptException.klass);
  245. smalltalk.addMethod(
  246. "_on_context_",
  247. smalltalk.method({
  248. selector: "on:context:",
  249. category: 'instance creation',
  250. fn: function (anException,aMethodContext){
  251. var self=this;
  252. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  253. $2=_st(self)._new();
  254. _st($2)._exception_(anException);
  255. _st($2)._context_(aMethodContext);
  256. $3=_st($2)._yourself();
  257. $1=$3;
  258. return $1;
  259. }, function($ctx1) {$ctx1.fill(self,"on:context:",{anException:anException,aMethodContext:aMethodContext}, smalltalk.JavaScriptException.klass)})},
  260. args: ["anException", "aMethodContext"],
  261. source: "on: anException context: aMethodContext\x0a\x09^ self new\x0a \x09exception: anException;\x0a context: aMethodContext;\x0a yourself",
  262. messageSends: ["exception:", "new", "context:", "yourself"],
  263. referencedClasses: []
  264. }),
  265. smalltalk.JavaScriptException.klass);
  266. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel-Exceptions');
  267. smalltalk.MessageNotUnderstood.comment="This exception is provided to support `Object>>doesNotUnderstand:`."
  268. smalltalk.addMethod(
  269. "_message",
  270. smalltalk.method({
  271. selector: "message",
  272. category: 'accessing',
  273. fn: function (){
  274. var self=this;
  275. return smalltalk.withContext(function($ctx1) { var $1;
  276. $1=self["@message"];
  277. return $1;
  278. }, function($ctx1) {$ctx1.fill(self,"message",{}, smalltalk.MessageNotUnderstood)})},
  279. args: [],
  280. source: "message\x0a\x09^message",
  281. messageSends: [],
  282. referencedClasses: []
  283. }),
  284. smalltalk.MessageNotUnderstood);
  285. smalltalk.addMethod(
  286. "_message_",
  287. smalltalk.method({
  288. selector: "message:",
  289. category: 'accessing',
  290. fn: function (aMessage){
  291. var self=this;
  292. return smalltalk.withContext(function($ctx1) { self["@message"]=aMessage;
  293. return self}, function($ctx1) {$ctx1.fill(self,"message:",{aMessage:aMessage}, smalltalk.MessageNotUnderstood)})},
  294. args: ["aMessage"],
  295. source: "message: aMessage\x0a\x09message := aMessage",
  296. messageSends: [],
  297. referencedClasses: []
  298. }),
  299. smalltalk.MessageNotUnderstood);
  300. smalltalk.addMethod(
  301. "_messageText",
  302. smalltalk.method({
  303. selector: "messageText",
  304. category: 'accessing',
  305. fn: function (){
  306. var self=this;
  307. return smalltalk.withContext(function($ctx1) { var $1;
  308. $1=_st(_st(_st(_st(self)._receiver())._asString()).__comma(" does not understand #")).__comma(_st(_st(self)._message())._selector());
  309. return $1;
  310. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.MessageNotUnderstood)})},
  311. args: [],
  312. source: "messageText\x0a\x09^self receiver asString, ' does not understand #', self message selector",
  313. messageSends: [",", "selector", "message", "asString", "receiver"],
  314. referencedClasses: []
  315. }),
  316. smalltalk.MessageNotUnderstood);
  317. smalltalk.addMethod(
  318. "_receiver",
  319. smalltalk.method({
  320. selector: "receiver",
  321. category: 'accessing',
  322. fn: function (){
  323. var self=this;
  324. return smalltalk.withContext(function($ctx1) { var $1;
  325. $1=self["@receiver"];
  326. return $1;
  327. }, function($ctx1) {$ctx1.fill(self,"receiver",{}, smalltalk.MessageNotUnderstood)})},
  328. args: [],
  329. source: "receiver\x0a\x09^receiver",
  330. messageSends: [],
  331. referencedClasses: []
  332. }),
  333. smalltalk.MessageNotUnderstood);
  334. smalltalk.addMethod(
  335. "_receiver_",
  336. smalltalk.method({
  337. selector: "receiver:",
  338. category: 'accessing',
  339. fn: function (anObject){
  340. var self=this;
  341. return smalltalk.withContext(function($ctx1) { self["@receiver"]=anObject;
  342. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject}, smalltalk.MessageNotUnderstood)})},
  343. args: ["anObject"],
  344. source: "receiver: anObject\x0a\x09receiver := anObject",
  345. messageSends: [],
  346. referencedClasses: []
  347. }),
  348. smalltalk.MessageNotUnderstood);
  349. smalltalk.addClass('NonBooleanReceiver', smalltalk.Error, ['object'], 'Kernel-Exceptions');
  350. smalltalk.NonBooleanReceiver.comment="NonBooleanReceiver exceptions may be thrown when executing inlined methods such as `#ifTrue:` with a non boolean receiver."
  351. smalltalk.addMethod(
  352. "_object",
  353. smalltalk.method({
  354. selector: "object",
  355. category: 'accessing',
  356. fn: function (){
  357. var self=this;
  358. return smalltalk.withContext(function($ctx1) { var $1;
  359. $1=self["@object"];
  360. return $1;
  361. }, function($ctx1) {$ctx1.fill(self,"object",{}, smalltalk.NonBooleanReceiver)})},
  362. args: [],
  363. source: "object\x0a\x09^ object",
  364. messageSends: [],
  365. referencedClasses: []
  366. }),
  367. smalltalk.NonBooleanReceiver);
  368. smalltalk.addMethod(
  369. "_object_",
  370. smalltalk.method({
  371. selector: "object:",
  372. category: 'accessing',
  373. fn: function (anObject){
  374. var self=this;
  375. return smalltalk.withContext(function($ctx1) { self["@object"]=anObject;
  376. return self}, function($ctx1) {$ctx1.fill(self,"object:",{anObject:anObject}, smalltalk.NonBooleanReceiver)})},
  377. args: ["anObject"],
  378. source: "object: anObject\x0a\x09object := anObject",
  379. messageSends: [],
  380. referencedClasses: []
  381. }),
  382. smalltalk.NonBooleanReceiver);
  383. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel-Exceptions');
  384. smalltalk.ErrorHandler.comment="ErrorHandler is used to manage Smalltalk errors. \x0aSee `boot.js` `handleError()` function.\x0a\x0aSubclasses of `ErrorHandler` can register themselves as the current handler with\x0a`ErrorHandler class >> register`.\x0a\x0aSubclasses may override `#handleError:` to perform an action on the thrown exception.\x0aThe default behavior is to log the error and the context stack to the JavaScript console."
  385. smalltalk.addMethod(
  386. "_handleError_",
  387. smalltalk.method({
  388. selector: "handleError:",
  389. category: 'error handling',
  390. fn: function (anError){
  391. var self=this;
  392. return smalltalk.withContext(function($ctx1) { var $1;
  393. $1=_st(anError)._context();
  394. if(($receiver = $1) == nil || $receiver == undefined){
  395. $1;
  396. } else {
  397. _st(self)._logErrorContext_(_st(anError)._context());
  398. };
  399. _st(self)._logError_(anError);
  400. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError}, smalltalk.ErrorHandler)})},
  401. args: ["anError"],
  402. source: "handleError: anError\x0a\x09anError context ifNotNil: [self logErrorContext: anError context].\x0a\x09self logError: anError",
  403. messageSends: ["ifNotNil:", "logErrorContext:", "context", "logError:"],
  404. referencedClasses: []
  405. }),
  406. smalltalk.ErrorHandler);
  407. smalltalk.addMethod(
  408. "_log_",
  409. smalltalk.method({
  410. selector: "log:",
  411. category: 'private',
  412. fn: function (aString){
  413. var self=this;
  414. return smalltalk.withContext(function($ctx1) { _st(console)._log_(aString);
  415. return self}, function($ctx1) {$ctx1.fill(self,"log:",{aString:aString}, smalltalk.ErrorHandler)})},
  416. args: ["aString"],
  417. source: "log: aString\x0a\x09console log: aString",
  418. messageSends: ["log:"],
  419. referencedClasses: []
  420. }),
  421. smalltalk.ErrorHandler);
  422. smalltalk.addMethod(
  423. "_logContext_",
  424. smalltalk.method({
  425. selector: "logContext:",
  426. category: 'private',
  427. fn: function (aContext){
  428. var self=this;
  429. return smalltalk.withContext(function($ctx1) { var $1;
  430. $1=_st(aContext)._home();
  431. if(($receiver = $1) == nil || $receiver == undefined){
  432. $1;
  433. } else {
  434. _st(self)._logContext_(_st(aContext)._home());
  435. };
  436. _st(self)._log_(_st(_st(_st(_st(aContext)._receiver())._asString()).__comma(">>")).__comma(_st(_st(aContext)._selector())._asString()));
  437. return self}, function($ctx1) {$ctx1.fill(self,"logContext:",{aContext:aContext}, smalltalk.ErrorHandler)})},
  438. args: ["aContext"],
  439. source: "logContext: aContext\x0a\x09aContext home ifNotNil: [\x0a\x09\x09self logContext: aContext home].\x0a\x09self log: aContext receiver asString, '>>', aContext selector asString",
  440. messageSends: ["ifNotNil:", "logContext:", "home", "log:", ",", "asString", "selector", "receiver"],
  441. referencedClasses: []
  442. }),
  443. smalltalk.ErrorHandler);
  444. smalltalk.addMethod(
  445. "_logError_",
  446. smalltalk.method({
  447. selector: "logError:",
  448. category: 'private',
  449. fn: function (anError){
  450. var self=this;
  451. return smalltalk.withContext(function($ctx1) { _st(self)._log_(_st(anError)._messageText());
  452. return self}, function($ctx1) {$ctx1.fill(self,"logError:",{anError:anError}, smalltalk.ErrorHandler)})},
  453. args: ["anError"],
  454. source: "logError: anError\x0a\x09self log: anError messageText",
  455. messageSends: ["log:", "messageText"],
  456. referencedClasses: []
  457. }),
  458. smalltalk.ErrorHandler);
  459. smalltalk.addMethod(
  460. "_logErrorContext_",
  461. smalltalk.method({
  462. selector: "logErrorContext:",
  463. category: 'private',
  464. fn: function (aContext){
  465. var self=this;
  466. return smalltalk.withContext(function($ctx1) { var $1,$3,$2;
  467. $1=aContext;
  468. $2=(function(){
  469. return smalltalk.withContext(function($ctx2) { $3=_st(aContext)._home();
  470. if(($receiver = $3) == nil || $receiver == undefined){
  471. return $3;
  472. } else {
  473. return _st(self)._logContext_(_st(aContext)._home());
  474. };
  475. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  476. _st($1)._ifNotNil_($2);
  477. return self}, function($ctx1) {$ctx1.fill(self,"logErrorContext:",{aContext:aContext}, smalltalk.ErrorHandler)})},
  478. args: ["aContext"],
  479. source: "logErrorContext: aContext\x0a\x09aContext ifNotNil: [\x0a\x09\x09aContext home ifNotNil: [\x0a\x09\x09\x09self logContext: aContext home]]",
  480. messageSends: ["ifNotNil:", "logContext:", "home"],
  481. referencedClasses: []
  482. }),
  483. smalltalk.ErrorHandler);
  484. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  485. smalltalk.addMethod(
  486. "_current",
  487. smalltalk.method({
  488. selector: "current",
  489. category: 'accessing',
  490. fn: function (){
  491. var self=this;
  492. return smalltalk.withContext(function($ctx1) { var $2,$1;
  493. $2=self["@current"];
  494. if(($receiver = $2) == nil || $receiver == undefined){
  495. self["@current"]=_st(self)._new();
  496. $1=self["@current"];
  497. } else {
  498. $1=$2;
  499. };
  500. return $1;
  501. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.ErrorHandler.klass)})},
  502. args: [],
  503. source: "current\x0a\x09^current ifNil: [current := self new]",
  504. messageSends: ["ifNil:", "new"],
  505. referencedClasses: []
  506. }),
  507. smalltalk.ErrorHandler.klass);
  508. smalltalk.addMethod(
  509. "_initialize",
  510. smalltalk.method({
  511. selector: "initialize",
  512. category: 'initialization',
  513. fn: function (){
  514. var self=this;
  515. return smalltalk.withContext(function($ctx1) { _st(self)._register();
  516. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ErrorHandler.klass)})},
  517. args: [],
  518. source: "initialize\x0a\x09self register",
  519. messageSends: ["register"],
  520. referencedClasses: []
  521. }),
  522. smalltalk.ErrorHandler.klass);
  523. smalltalk.addMethod(
  524. "_register",
  525. smalltalk.method({
  526. selector: "register",
  527. category: 'initialization',
  528. fn: function (){
  529. var self=this;
  530. return smalltalk.withContext(function($ctx1) { _st((smalltalk.ErrorHandler || ErrorHandler))._setCurrent_(_st(self)._new());
  531. return self}, function($ctx1) {$ctx1.fill(self,"register",{}, smalltalk.ErrorHandler.klass)})},
  532. args: [],
  533. source: "register\x0a\x09ErrorHandler setCurrent: self new",
  534. messageSends: ["setCurrent:", "new"],
  535. referencedClasses: ["ErrorHandler"]
  536. }),
  537. smalltalk.ErrorHandler.klass);
  538. smalltalk.addMethod(
  539. "_setCurrent_",
  540. smalltalk.method({
  541. selector: "setCurrent:",
  542. category: 'accessing',
  543. fn: function (anHandler){
  544. var self=this;
  545. return smalltalk.withContext(function($ctx1) { self["@current"]=anHandler;
  546. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler}, smalltalk.ErrorHandler.klass)})},
  547. args: ["anHandler"],
  548. source: "setCurrent: anHandler\x0a\x09current := anHandler",
  549. messageSends: [],
  550. referencedClasses: []
  551. }),
  552. smalltalk.ErrorHandler.klass);