Kernel-Exceptions.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  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: "signal",
  130. category: 'instance creation',
  131. fn: function (){
  132. var self=this;
  133. return smalltalk.withContext(function($ctx1) {
  134. 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. smalltalk.method({
  146. selector: "signal:",
  147. category: 'instance creation',
  148. fn: function (aString){
  149. var self=this;
  150. return smalltalk.withContext(function($ctx1) {
  151. 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\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. smalltalk.method({
  165. selector: "context:",
  166. category: 'accessing',
  167. fn: function (aMethodContext){
  168. var self=this;
  169. return smalltalk.withContext(function($ctx1) {
  170. 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\x09See boot.js `inContext()` exception handling\x22\x0a\x09\x0a\x09<self.context = aMethodContext>",
  174. messageSends: [],
  175. referencedClasses: []
  176. }),
  177. smalltalk.JavaScriptException);
  178. smalltalk.addMethod(
  179. smalltalk.method({
  180. selector: "exception",
  181. category: 'accessing',
  182. fn: function (){
  183. var self=this;
  184. return smalltalk.withContext(function($ctx1) {
  185. 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. smalltalk.method({
  197. selector: "exception:",
  198. category: 'accessing',
  199. fn: function (anException){
  200. var self=this;
  201. return smalltalk.withContext(function($ctx1) {
  202. 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. smalltalk.method({
  212. selector: "messageText",
  213. category: 'accessing',
  214. fn: function (){
  215. var self=this;
  216. return smalltalk.withContext(function($ctx1) {
  217. 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. smalltalk.method({
  227. selector: "on:",
  228. category: 'instance creation',
  229. fn: function (anException){
  230. var self=this;
  231. return smalltalk.withContext(function($ctx1) {
  232. 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\x09\x09exception: anException;\x0a\x09\x09yourself",
  241. messageSends: ["exception:", "new", "yourself"],
  242. referencedClasses: []
  243. }),
  244. smalltalk.JavaScriptException.klass);
  245. smalltalk.addMethod(
  246. smalltalk.method({
  247. selector: "on:context:",
  248. category: 'instance creation',
  249. fn: function (anException,aMethodContext){
  250. var self=this;
  251. return smalltalk.withContext(function($ctx1) {
  252. 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\x09\x09exception: anException;\x0a\x09\x09context: aMethodContext;\x0a\x09\x09yourself",
  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. smalltalk.method({
  270. selector: "message",
  271. category: 'accessing',
  272. fn: function (){
  273. var self=this;
  274. return smalltalk.withContext(function($ctx1) {
  275. 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. smalltalk.method({
  287. selector: "message:",
  288. category: 'accessing',
  289. fn: function (aMessage){
  290. var self=this;
  291. return smalltalk.withContext(function($ctx1) {
  292. 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. smalltalk.method({
  302. selector: "messageText",
  303. category: 'accessing',
  304. fn: function (){
  305. var self=this;
  306. return smalltalk.withContext(function($ctx1) {
  307. 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. smalltalk.method({
  319. selector: "receiver",
  320. category: 'accessing',
  321. fn: function (){
  322. var self=this;
  323. return smalltalk.withContext(function($ctx1) {
  324. 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. smalltalk.method({
  336. selector: "receiver:",
  337. category: 'accessing',
  338. fn: function (anObject){
  339. var self=this;
  340. return smalltalk.withContext(function($ctx1) {
  341. 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. smalltalk.method({
  353. selector: "object",
  354. category: 'accessing',
  355. fn: function (){
  356. var self=this;
  357. return smalltalk.withContext(function($ctx1) {
  358. 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. smalltalk.method({
  370. selector: "object:",
  371. category: 'accessing',
  372. fn: function (anObject){
  373. var self=this;
  374. return smalltalk.withContext(function($ctx1) {
  375. 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. smalltalk.method({
  387. selector: "handleError:",
  388. category: 'error handling',
  389. fn: function (anError){
  390. var self=this;
  391. return smalltalk.withContext(function($ctx1) {
  392. 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. smalltalk.method({
  409. selector: "log:",
  410. category: 'private',
  411. fn: function (aString){
  412. var self=this;
  413. return smalltalk.withContext(function($ctx1) {
  414. _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. smalltalk.method({
  424. selector: "logContext:",
  425. category: 'private',
  426. fn: function (aContext){
  427. var self=this;
  428. return smalltalk.withContext(function($ctx1) {
  429. 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. smalltalk.method({
  446. selector: "logError:",
  447. category: 'private',
  448. fn: function (anError){
  449. var self=this;
  450. return smalltalk.withContext(function($ctx1) {
  451. _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. smalltalk.method({
  461. selector: "logErrorContext:",
  462. category: 'private',
  463. fn: function (aContext){
  464. var self=this;
  465. return smalltalk.withContext(function($ctx1) {
  466. var $1,$2;
  467. $1=aContext;
  468. if(($receiver = $1) == nil || $receiver == undefined){
  469. $1;
  470. } else {
  471. $2=_st(aContext)._home();
  472. if(($receiver = $2) == nil || $receiver == undefined){
  473. $2;
  474. } else {
  475. _st(self)._logContext_(_st(aContext)._home());
  476. };
  477. };
  478. return self}, function($ctx1) {$ctx1.fill(self,"logErrorContext:",{aContext:aContext},smalltalk.ErrorHandler)})},
  479. args: ["aContext"],
  480. source: "logErrorContext: aContext\x0a\x09aContext ifNotNil: [\x0a\x09\x09aContext home ifNotNil: [\x0a\x09\x09\x09self logContext: aContext home]]",
  481. messageSends: ["ifNotNil:", "logContext:", "home"],
  482. referencedClasses: []
  483. }),
  484. smalltalk.ErrorHandler);
  485. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  486. smalltalk.addMethod(
  487. smalltalk.method({
  488. selector: "current",
  489. category: 'accessing',
  490. fn: function (){
  491. var self=this;
  492. return smalltalk.withContext(function($ctx1) {
  493. var $2,$1;
  494. $2=self["@current"];
  495. if(($receiver = $2) == nil || $receiver == undefined){
  496. self["@current"]=_st(self)._new();
  497. $1=self["@current"];
  498. } else {
  499. $1=$2;
  500. };
  501. return $1;
  502. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.ErrorHandler.klass)})},
  503. args: [],
  504. source: "current\x0a\x09^current ifNil: [current := self new]",
  505. messageSends: ["ifNil:", "new"],
  506. referencedClasses: []
  507. }),
  508. smalltalk.ErrorHandler.klass);
  509. smalltalk.addMethod(
  510. smalltalk.method({
  511. selector: "initialize",
  512. category: 'initialization',
  513. fn: function (){
  514. var self=this;
  515. return smalltalk.withContext(function($ctx1) {
  516. _st(self)._register();
  517. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ErrorHandler.klass)})},
  518. args: [],
  519. source: "initialize\x0a\x09self register",
  520. messageSends: ["register"],
  521. referencedClasses: []
  522. }),
  523. smalltalk.ErrorHandler.klass);
  524. smalltalk.addMethod(
  525. smalltalk.method({
  526. selector: "register",
  527. category: 'initialization',
  528. fn: function (){
  529. var self=this;
  530. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  531. return smalltalk.withContext(function($ctx1) {
  532. _st($ErrorHandler())._setCurrent_(_st(self)._new());
  533. return self}, function($ctx1) {$ctx1.fill(self,"register",{},smalltalk.ErrorHandler.klass)})},
  534. args: [],
  535. source: "register\x0a\x09ErrorHandler setCurrent: self new",
  536. messageSends: ["setCurrent:", "new"],
  537. referencedClasses: ["ErrorHandler"]
  538. }),
  539. smalltalk.ErrorHandler.klass);
  540. smalltalk.addMethod(
  541. smalltalk.method({
  542. selector: "setCurrent:",
  543. category: 'accessing',
  544. fn: function (anHandler){
  545. var self=this;
  546. return smalltalk.withContext(function($ctx1) {
  547. self["@current"]=anHandler;
  548. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler},smalltalk.ErrorHandler.klass)})},
  549. args: ["anHandler"],
  550. source: "setCurrent: anHandler\x0a\x09current := anHandler",
  551. messageSends: [],
  552. referencedClasses: []
  553. }),
  554. smalltalk.ErrorHandler.klass);