1
0

Kernel-Exceptions.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  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) { _st(anException)._messageText_(_st(anException)._basicAt_("message"));
  203. self["@exception"]=anException;
  204. return self}, function($ctx1) {$ctx1.fill(self,"exception:",{anException:anException}, smalltalk.JavaScriptException)})},
  205. args: ["anException"],
  206. source: "exception: anException\x0a\x09anException messageText: (anException basicAt: 'message').\x0a\x09exception := anException",
  207. messageSends: ["messageText:", "basicAt:"],
  208. referencedClasses: []
  209. }),
  210. smalltalk.JavaScriptException);
  211. smalltalk.addMethod(
  212. "_messageText",
  213. smalltalk.method({
  214. selector: "messageText",
  215. category: 'accessing',
  216. fn: function (){
  217. var self=this;
  218. return smalltalk.withContext(function($ctx1) { var $1;
  219. $1=_st("JavaScript exception: ").__comma(_st(_st(self)._exception())._messageText());
  220. return $1;
  221. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.JavaScriptException)})},
  222. args: [],
  223. source: "messageText\x0a\x09^ 'JavaScript exception: ', self exception messageText",
  224. messageSends: [",", "messageText", "exception"],
  225. referencedClasses: []
  226. }),
  227. smalltalk.JavaScriptException);
  228. smalltalk.addMethod(
  229. "_on_",
  230. smalltalk.method({
  231. selector: "on:",
  232. category: 'instance creation',
  233. fn: function (anException){
  234. var self=this;
  235. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  236. $2=_st(self)._new();
  237. _st($2)._exception_(anException);
  238. $3=_st($2)._yourself();
  239. $1=$3;
  240. return $1;
  241. }, function($ctx1) {$ctx1.fill(self,"on:",{anException:anException}, smalltalk.JavaScriptException.klass)})},
  242. args: ["anException"],
  243. source: "on: anException\x0a\x09^ self new\x0a \x09exception: anException;\x0a yourself",
  244. messageSends: ["exception:", "new", "yourself"],
  245. referencedClasses: []
  246. }),
  247. smalltalk.JavaScriptException.klass);
  248. smalltalk.addMethod(
  249. "_on_context_",
  250. smalltalk.method({
  251. selector: "on:context:",
  252. category: 'instance creation',
  253. fn: function (anException,aMethodContext){
  254. var self=this;
  255. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  256. $2=_st(self)._new();
  257. _st($2)._exception_(anException);
  258. _st($2)._context_(aMethodContext);
  259. $3=_st($2)._yourself();
  260. $1=$3;
  261. return $1;
  262. }, function($ctx1) {$ctx1.fill(self,"on:context:",{anException:anException,aMethodContext:aMethodContext}, smalltalk.JavaScriptException.klass)})},
  263. args: ["anException", "aMethodContext"],
  264. source: "on: anException context: aMethodContext\x0a\x09^ self new\x0a \x09exception: anException;\x0a context: aMethodContext;\x0a yourself",
  265. messageSends: ["exception:", "new", "context:", "yourself"],
  266. referencedClasses: []
  267. }),
  268. smalltalk.JavaScriptException.klass);
  269. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel-Exceptions');
  270. smalltalk.MessageNotUnderstood.comment="This exception is provided to support `Object>>doesNotUnderstand:`."
  271. smalltalk.addMethod(
  272. "_message",
  273. smalltalk.method({
  274. selector: "message",
  275. category: 'accessing',
  276. fn: function (){
  277. var self=this;
  278. return smalltalk.withContext(function($ctx1) { var $1;
  279. $1=self["@message"];
  280. return $1;
  281. }, function($ctx1) {$ctx1.fill(self,"message",{}, smalltalk.MessageNotUnderstood)})},
  282. args: [],
  283. source: "message\x0a\x09^message",
  284. messageSends: [],
  285. referencedClasses: []
  286. }),
  287. smalltalk.MessageNotUnderstood);
  288. smalltalk.addMethod(
  289. "_message_",
  290. smalltalk.method({
  291. selector: "message:",
  292. category: 'accessing',
  293. fn: function (aMessage){
  294. var self=this;
  295. return smalltalk.withContext(function($ctx1) { self["@message"]=aMessage;
  296. return self}, function($ctx1) {$ctx1.fill(self,"message:",{aMessage:aMessage}, smalltalk.MessageNotUnderstood)})},
  297. args: ["aMessage"],
  298. source: "message: aMessage\x0a\x09message := aMessage",
  299. messageSends: [],
  300. referencedClasses: []
  301. }),
  302. smalltalk.MessageNotUnderstood);
  303. smalltalk.addMethod(
  304. "_messageText",
  305. smalltalk.method({
  306. selector: "messageText",
  307. category: 'accessing',
  308. fn: function (){
  309. var self=this;
  310. return smalltalk.withContext(function($ctx1) { var $1;
  311. $1=_st(_st(_st(_st(self)._receiver())._asString()).__comma(" does not understand #")).__comma(_st(_st(self)._message())._selector());
  312. return $1;
  313. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.MessageNotUnderstood)})},
  314. args: [],
  315. source: "messageText\x0a\x09^self receiver asString, ' does not understand #', self message selector",
  316. messageSends: [",", "selector", "message", "asString", "receiver"],
  317. referencedClasses: []
  318. }),
  319. smalltalk.MessageNotUnderstood);
  320. smalltalk.addMethod(
  321. "_receiver",
  322. smalltalk.method({
  323. selector: "receiver",
  324. category: 'accessing',
  325. fn: function (){
  326. var self=this;
  327. return smalltalk.withContext(function($ctx1) { var $1;
  328. $1=self["@receiver"];
  329. return $1;
  330. }, function($ctx1) {$ctx1.fill(self,"receiver",{}, smalltalk.MessageNotUnderstood)})},
  331. args: [],
  332. source: "receiver\x0a\x09^receiver",
  333. messageSends: [],
  334. referencedClasses: []
  335. }),
  336. smalltalk.MessageNotUnderstood);
  337. smalltalk.addMethod(
  338. "_receiver_",
  339. smalltalk.method({
  340. selector: "receiver:",
  341. category: 'accessing',
  342. fn: function (anObject){
  343. var self=this;
  344. return smalltalk.withContext(function($ctx1) { self["@receiver"]=anObject;
  345. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject}, smalltalk.MessageNotUnderstood)})},
  346. args: ["anObject"],
  347. source: "receiver: anObject\x0a\x09receiver := anObject",
  348. messageSends: [],
  349. referencedClasses: []
  350. }),
  351. smalltalk.MessageNotUnderstood);
  352. smalltalk.addClass('NonBooleanReceiver', smalltalk.Error, ['object'], 'Kernel-Exceptions');
  353. smalltalk.NonBooleanReceiver.comment="NonBooleanReceiver exceptions may be thrown when executing inlined methods such as `#ifTrue:` with a non boolean receiver."
  354. smalltalk.addMethod(
  355. "_object",
  356. smalltalk.method({
  357. selector: "object",
  358. category: 'accessing',
  359. fn: function (){
  360. var self=this;
  361. return smalltalk.withContext(function($ctx1) { var $1;
  362. $1=self["@object"];
  363. return $1;
  364. }, function($ctx1) {$ctx1.fill(self,"object",{}, smalltalk.NonBooleanReceiver)})},
  365. args: [],
  366. source: "object\x0a\x09^ object",
  367. messageSends: [],
  368. referencedClasses: []
  369. }),
  370. smalltalk.NonBooleanReceiver);
  371. smalltalk.addMethod(
  372. "_object_",
  373. smalltalk.method({
  374. selector: "object:",
  375. category: 'accessing',
  376. fn: function (anObject){
  377. var self=this;
  378. return smalltalk.withContext(function($ctx1) { self["@object"]=anObject;
  379. return self}, function($ctx1) {$ctx1.fill(self,"object:",{anObject:anObject}, smalltalk.NonBooleanReceiver)})},
  380. args: ["anObject"],
  381. source: "object: anObject\x0a\x09object := anObject",
  382. messageSends: [],
  383. referencedClasses: []
  384. }),
  385. smalltalk.NonBooleanReceiver);
  386. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel-Exceptions');
  387. 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."
  388. smalltalk.addMethod(
  389. "_handleError_",
  390. smalltalk.method({
  391. selector: "handleError:",
  392. category: 'error handling',
  393. fn: function (anError){
  394. var self=this;
  395. return smalltalk.withContext(function($ctx1) { var $1;
  396. $1=_st(anError)._context();
  397. if(($receiver = $1) == nil || $receiver == undefined){
  398. $1;
  399. } else {
  400. _st(self)._logErrorContext_(_st(anError)._context());
  401. };
  402. _st(self)._logError_(anError);
  403. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError}, smalltalk.ErrorHandler)})},
  404. args: ["anError"],
  405. source: "handleError: anError\x0a\x09anError context ifNotNil: [self logErrorContext: anError context].\x0a\x09self logError: anError",
  406. messageSends: ["ifNotNil:", "logErrorContext:", "context", "logError:"],
  407. referencedClasses: []
  408. }),
  409. smalltalk.ErrorHandler);
  410. smalltalk.addMethod(
  411. "_log_",
  412. smalltalk.method({
  413. selector: "log:",
  414. category: 'private',
  415. fn: function (aString){
  416. var self=this;
  417. return smalltalk.withContext(function($ctx1) { _st(console)._log_(aString);
  418. return self}, function($ctx1) {$ctx1.fill(self,"log:",{aString:aString}, smalltalk.ErrorHandler)})},
  419. args: ["aString"],
  420. source: "log: aString\x0a\x09console log: aString",
  421. messageSends: ["log:"],
  422. referencedClasses: []
  423. }),
  424. smalltalk.ErrorHandler);
  425. smalltalk.addMethod(
  426. "_logContext_",
  427. smalltalk.method({
  428. selector: "logContext:",
  429. category: 'private',
  430. fn: function (aContext){
  431. var self=this;
  432. return smalltalk.withContext(function($ctx1) { var $1;
  433. $1=_st(aContext)._home();
  434. if(($receiver = $1) == nil || $receiver == undefined){
  435. $1;
  436. } else {
  437. _st(self)._logContext_(_st(aContext)._home());
  438. };
  439. _st(self)._log_(_st(_st(_st(_st(aContext)._receiver())._asString()).__comma(">>")).__comma(_st(_st(aContext)._selector())._asString()));
  440. return self}, function($ctx1) {$ctx1.fill(self,"logContext:",{aContext:aContext}, smalltalk.ErrorHandler)})},
  441. args: ["aContext"],
  442. source: "logContext: aContext\x0a\x09aContext home ifNotNil: [\x0a\x09\x09self logContext: aContext home].\x0a\x09self log: aContext receiver asString, '>>', aContext selector asString",
  443. messageSends: ["ifNotNil:", "logContext:", "home", "log:", ",", "asString", "selector", "receiver"],
  444. referencedClasses: []
  445. }),
  446. smalltalk.ErrorHandler);
  447. smalltalk.addMethod(
  448. "_logError_",
  449. smalltalk.method({
  450. selector: "logError:",
  451. category: 'private',
  452. fn: function (anError){
  453. var self=this;
  454. return smalltalk.withContext(function($ctx1) { _st(self)._log_(_st(anError)._messageText());
  455. return self}, function($ctx1) {$ctx1.fill(self,"logError:",{anError:anError}, smalltalk.ErrorHandler)})},
  456. args: ["anError"],
  457. source: "logError: anError\x0a\x09self log: anError messageText",
  458. messageSends: ["log:", "messageText"],
  459. referencedClasses: []
  460. }),
  461. smalltalk.ErrorHandler);
  462. smalltalk.addMethod(
  463. "_logErrorContext_",
  464. smalltalk.method({
  465. selector: "logErrorContext:",
  466. category: 'private',
  467. fn: function (aContext){
  468. var self=this;
  469. return smalltalk.withContext(function($ctx1) { var $1,$3,$2;
  470. $1=aContext;
  471. $2=(function(){
  472. return smalltalk.withContext(function($ctx2) { $3=_st(aContext)._home();
  473. if(($receiver = $3) == nil || $receiver == undefined){
  474. return $3;
  475. } else {
  476. return _st(self)._logContext_(_st(aContext)._home());
  477. };
  478. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  479. _st($1)._ifNotNil_($2);
  480. return self}, function($ctx1) {$ctx1.fill(self,"logErrorContext:",{aContext:aContext}, smalltalk.ErrorHandler)})},
  481. args: ["aContext"],
  482. source: "logErrorContext: aContext\x0a\x09aContext ifNotNil: [\x0a\x09\x09aContext home ifNotNil: [\x0a\x09\x09\x09self logContext: aContext home]]",
  483. messageSends: ["ifNotNil:", "logContext:", "home"],
  484. referencedClasses: []
  485. }),
  486. smalltalk.ErrorHandler);
  487. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  488. smalltalk.addMethod(
  489. "_current",
  490. smalltalk.method({
  491. selector: "current",
  492. category: 'accessing',
  493. fn: function (){
  494. var self=this;
  495. return smalltalk.withContext(function($ctx1) { var $2,$1;
  496. $2=self["@current"];
  497. if(($receiver = $2) == nil || $receiver == undefined){
  498. self["@current"]=_st(self)._new();
  499. $1=self["@current"];
  500. } else {
  501. $1=$2;
  502. };
  503. return $1;
  504. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.ErrorHandler.klass)})},
  505. args: [],
  506. source: "current\x0a\x09^current ifNil: [current := self new]",
  507. messageSends: ["ifNil:", "new"],
  508. referencedClasses: []
  509. }),
  510. smalltalk.ErrorHandler.klass);
  511. smalltalk.addMethod(
  512. "_initialize",
  513. smalltalk.method({
  514. selector: "initialize",
  515. category: 'initialization',
  516. fn: function (){
  517. var self=this;
  518. return smalltalk.withContext(function($ctx1) { _st(self)._register();
  519. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ErrorHandler.klass)})},
  520. args: [],
  521. source: "initialize\x0a\x09self register",
  522. messageSends: ["register"],
  523. referencedClasses: []
  524. }),
  525. smalltalk.ErrorHandler.klass);
  526. smalltalk.addMethod(
  527. "_register",
  528. smalltalk.method({
  529. selector: "register",
  530. category: 'initialization',
  531. fn: function (){
  532. var self=this;
  533. return smalltalk.withContext(function($ctx1) { _st((smalltalk.ErrorHandler || ErrorHandler))._setCurrent_(_st(self)._new());
  534. return self}, function($ctx1) {$ctx1.fill(self,"register",{}, smalltalk.ErrorHandler.klass)})},
  535. args: [],
  536. source: "register\x0a\x09ErrorHandler setCurrent: self new",
  537. messageSends: ["setCurrent:", "new"],
  538. referencedClasses: ["ErrorHandler"]
  539. }),
  540. smalltalk.ErrorHandler.klass);
  541. smalltalk.addMethod(
  542. "_setCurrent_",
  543. smalltalk.method({
  544. selector: "setCurrent:",
  545. category: 'accessing',
  546. fn: function (anHandler){
  547. var self=this;
  548. return smalltalk.withContext(function($ctx1) { self["@current"]=anHandler;
  549. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler}, smalltalk.ErrorHandler.klass)})},
  550. args: ["anHandler"],
  551. source: "setCurrent: anHandler\x0a\x09current := anHandler",
  552. messageSends: [],
  553. referencedClasses: []
  554. }),
  555. smalltalk.ErrorHandler.klass);