Kernel-Exceptions.js 19 KB

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