Kernel-Exceptions.js 19 KB

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