2
0

Kernel-Exceptions.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. smalltalk.addPackage('Kernel-Exceptions', {});
  2. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
  3. smalltalk.addMethod(
  4. unescape('_messageText'),
  5. smalltalk.method({
  6. selector: unescape('messageText'),
  7. category: 'accessing',
  8. fn: function (){
  9. var self=this;
  10. return self['@messageText'];
  11. return self;},
  12. args: [],
  13. source: unescape('messageText%0A%09%5EmessageText'),
  14. messageSends: [],
  15. referencedClasses: []
  16. }),
  17. smalltalk.Error);
  18. smalltalk.addMethod(
  19. unescape('_messageText_'),
  20. smalltalk.method({
  21. selector: unescape('messageText%3A'),
  22. category: 'accessing',
  23. fn: function (aString){
  24. var self=this;
  25. (self['@messageText']=aString);
  26. return self;},
  27. args: ["aString"],
  28. source: unescape('messageText%3A%20aString%0A%09messageText%20%3A%3D%20aString'),
  29. messageSends: [],
  30. referencedClasses: []
  31. }),
  32. smalltalk.Error);
  33. smalltalk.addMethod(
  34. unescape('_signal'),
  35. smalltalk.method({
  36. selector: unescape('signal'),
  37. category: 'signaling',
  38. fn: function (){
  39. var self=this;
  40. self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
  41. return self;},
  42. args: [],
  43. source: unescape('signal%0A%09%3Cself.context%20%3D%20smalltalk.getThisContext%28%29%3B%20self.smalltalkError%20%3D%20true%3B%20throw%28self%29%3E'),
  44. messageSends: [],
  45. referencedClasses: []
  46. }),
  47. smalltalk.Error);
  48. smalltalk.addMethod(
  49. unescape('_context'),
  50. smalltalk.method({
  51. selector: unescape('context'),
  52. category: 'accessing',
  53. fn: function (){
  54. var self=this;
  55. return self.context;
  56. return self;},
  57. args: [],
  58. source: unescape('context%0A%09%3Creturn%20self.context%3E'),
  59. messageSends: [],
  60. referencedClasses: []
  61. }),
  62. smalltalk.Error);
  63. smalltalk.addMethod(
  64. unescape('_jsStack'),
  65. smalltalk.method({
  66. selector: unescape('jsStack'),
  67. category: 'accessing',
  68. fn: function (){
  69. var self=this;
  70. return self.stack;
  71. return self;},
  72. args: [],
  73. source: unescape('jsStack%0A%09%3Creturn%20self.stack%3E'),
  74. messageSends: [],
  75. referencedClasses: []
  76. }),
  77. smalltalk.Error);
  78. smalltalk.addMethod(
  79. unescape('_isSmalltalkError'),
  80. smalltalk.method({
  81. selector: unescape('isSmalltalkError'),
  82. category: 'testing',
  83. fn: function (){
  84. var self=this;
  85. return self.smalltalkError === true;
  86. return self;},
  87. args: [],
  88. source: unescape('isSmalltalkError%0A%09%3Creturn%20self.smalltalkError%20%3D%3D%3D%20true%3E'),
  89. messageSends: [],
  90. referencedClasses: []
  91. }),
  92. smalltalk.Error);
  93. smalltalk.addMethod(
  94. unescape('_signal_'),
  95. smalltalk.method({
  96. selector: unescape('signal%3A'),
  97. category: 'instance creation',
  98. fn: function (aString){
  99. var self=this;
  100. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  101. return self;},
  102. args: ["aString"],
  103. source: unescape('signal%3A%20aString%0A%09%20%20%20%20%5Eself%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal'),
  104. messageSends: ["messageText:", "signal", "new"],
  105. referencedClasses: []
  106. }),
  107. smalltalk.Error.klass);
  108. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel-Exceptions');
  109. smalltalk.addMethod(
  110. unescape('_message'),
  111. smalltalk.method({
  112. selector: unescape('message'),
  113. category: 'accessing',
  114. fn: function (){
  115. var self=this;
  116. return self['@message'];
  117. return self;},
  118. args: [],
  119. source: unescape('message%0A%09%5Emessage'),
  120. messageSends: [],
  121. referencedClasses: []
  122. }),
  123. smalltalk.MessageNotUnderstood);
  124. smalltalk.addMethod(
  125. unescape('_message_'),
  126. smalltalk.method({
  127. selector: unescape('message%3A'),
  128. category: 'accessing',
  129. fn: function (aMessage){
  130. var self=this;
  131. (self['@message']=aMessage);
  132. return self;},
  133. args: ["aMessage"],
  134. source: unescape('message%3A%20aMessage%0A%09message%20%3A%3D%20aMessage'),
  135. messageSends: [],
  136. referencedClasses: []
  137. }),
  138. smalltalk.MessageNotUnderstood);
  139. smalltalk.addMethod(
  140. unescape('_receiver'),
  141. smalltalk.method({
  142. selector: unescape('receiver'),
  143. category: 'accessing',
  144. fn: function (){
  145. var self=this;
  146. return self['@receiver'];
  147. return self;},
  148. args: [],
  149. source: unescape('receiver%0A%09%5Ereceiver'),
  150. messageSends: [],
  151. referencedClasses: []
  152. }),
  153. smalltalk.MessageNotUnderstood);
  154. smalltalk.addMethod(
  155. unescape('_receiver_'),
  156. smalltalk.method({
  157. selector: unescape('receiver%3A'),
  158. category: 'accessing',
  159. fn: function (anObject){
  160. var self=this;
  161. (self['@receiver']=anObject);
  162. return self;},
  163. args: ["anObject"],
  164. source: unescape('receiver%3A%20anObject%0A%09receiver%20%3A%3D%20anObject'),
  165. messageSends: [],
  166. referencedClasses: []
  167. }),
  168. smalltalk.MessageNotUnderstood);
  169. smalltalk.addMethod(
  170. unescape('_messageText'),
  171. smalltalk.method({
  172. selector: unescape('messageText'),
  173. category: 'accessing',
  174. fn: function (){
  175. var self=this;
  176. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_asString", []), "__comma", [unescape("%20does%20not%20understand%20%23")]), "__comma", [smalltalk.send(smalltalk.send(self, "_message", []), "_selector", [])]);
  177. return self;},
  178. args: [],
  179. source: unescape('messageText%0A%09%5Eself%20receiver%20asString%2C%20%27%20does%20not%20understand%20%23%27%2C%20self%20message%20selector'),
  180. messageSends: [unescape("%2C"), "asString", "receiver", "selector", "message"],
  181. referencedClasses: []
  182. }),
  183. smalltalk.MessageNotUnderstood);
  184. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel-Exceptions');
  185. smalltalk.addMethod(
  186. unescape('_handleError_'),
  187. smalltalk.method({
  188. selector: unescape('handleError%3A'),
  189. category: 'error handling',
  190. fn: function (anError){
  191. var self=this;
  192. (($receiver = smalltalk.send(anError, "_context", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})() : nil;
  193. smalltalk.send(self, "_logError_", [anError]);
  194. return self;},
  195. args: ["anError"],
  196. source: unescape('handleError%3A%20anError%0A%09anError%20context%20ifNotNil%3A%20%5Bself%20logErrorContext%3A%20anError%20context%5D.%0A%09self%20logError%3A%20anError'),
  197. messageSends: ["ifNotNil:", "context", "logErrorContext:", "logError:"],
  198. referencedClasses: []
  199. }),
  200. smalltalk.ErrorHandler);
  201. smalltalk.addMethod(
  202. unescape('_logContext_'),
  203. smalltalk.method({
  204. selector: unescape('logContext%3A'),
  205. category: 'private',
  206. fn: function (aContext){
  207. var self=this;
  208. (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;
  209. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  210. return self;},
  211. args: ["aContext"],
  212. source: unescape('logContext%3A%20aContext%0A%09aContext%20home%20ifNotNil%3A%20%5B%0A%09%09self%20logContext%3A%20aContext%20home%5D.%0A%09self%20log%3A%20aContext%20receiver%20asString%2C%20%27%3E%3E%27%2C%20aContext%20selector'),
  213. messageSends: ["ifNotNil:", "home", "logContext:", "log:", unescape("%2C"), "asString", "receiver", "selector"],
  214. referencedClasses: []
  215. }),
  216. smalltalk.ErrorHandler);
  217. smalltalk.addMethod(
  218. unescape('_logErrorContext_'),
  219. smalltalk.method({
  220. selector: unescape('logErrorContext%3A'),
  221. category: 'private',
  222. fn: function (aContext){
  223. var self=this;
  224. (($receiver = aContext) != nil && $receiver != undefined) ? (function(){return (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;})() : nil;
  225. return self;},
  226. args: ["aContext"],
  227. source: unescape('logErrorContext%3A%20aContext%0A%09aContext%20ifNotNil%3A%20%5B%0A%09%09aContext%20home%20ifNotNil%3A%20%5B%0A%09%09%09self%20logContext%3A%20aContext%20home%5D%5D'),
  228. messageSends: ["ifNotNil:", "home", "logContext:"],
  229. referencedClasses: []
  230. }),
  231. smalltalk.ErrorHandler);
  232. smalltalk.addMethod(
  233. unescape('_logError_'),
  234. smalltalk.method({
  235. selector: unescape('logError%3A'),
  236. category: 'private',
  237. fn: function (anError){
  238. var self=this;
  239. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  240. return self;},
  241. args: ["anError"],
  242. source: unescape('logError%3A%20anError%0A%09self%20log%3A%20anError%20messageText'),
  243. messageSends: ["log:", "messageText"],
  244. referencedClasses: []
  245. }),
  246. smalltalk.ErrorHandler);
  247. smalltalk.addMethod(
  248. unescape('_log_'),
  249. smalltalk.method({
  250. selector: unescape('log%3A'),
  251. category: 'private',
  252. fn: function (aString){
  253. var self=this;
  254. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [aString]);
  255. return self;},
  256. args: ["aString"],
  257. source: unescape('log%3A%20aString%0A%09console%20log%3A%20aString'),
  258. messageSends: ["log:"],
  259. referencedClasses: []
  260. }),
  261. smalltalk.ErrorHandler);
  262. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  263. smalltalk.addMethod(
  264. unescape('_current'),
  265. smalltalk.method({
  266. selector: unescape('current'),
  267. category: 'accessing',
  268. fn: function (){
  269. var self=this;
  270. return (($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){return (self['@current']=smalltalk.send(self, "_new", []));})() : $receiver;
  271. return self;},
  272. args: [],
  273. source: unescape('current%0A%09%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20self%20new%5D'),
  274. messageSends: ["ifNil:", "new"],
  275. referencedClasses: []
  276. }),
  277. smalltalk.ErrorHandler.klass);
  278. smalltalk.addMethod(
  279. unescape('_initialize'),
  280. smalltalk.method({
  281. selector: unescape('initialize'),
  282. category: 'initialization',
  283. fn: function (){
  284. var self=this;
  285. smalltalk.send(self, "_register", []);
  286. return self;},
  287. args: [],
  288. source: unescape('initialize%0A%09self%20register'),
  289. messageSends: ["register"],
  290. referencedClasses: []
  291. }),
  292. smalltalk.ErrorHandler.klass);
  293. smalltalk.addMethod(
  294. unescape('_register'),
  295. smalltalk.method({
  296. selector: unescape('register'),
  297. category: 'initialization',
  298. fn: function (){
  299. var self=this;
  300. smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  301. return self;},
  302. args: [],
  303. source: unescape('register%0A%09ErrorHandler%20setCurrent%3A%20self%20new'),
  304. messageSends: ["setCurrent:", "new"],
  305. referencedClasses: ["ErrorHandler"]
  306. }),
  307. smalltalk.ErrorHandler.klass);
  308. smalltalk.addMethod(
  309. unescape('_setCurrent_'),
  310. smalltalk.method({
  311. selector: unescape('setCurrent%3A'),
  312. category: 'accessing',
  313. fn: function (anHandler){
  314. var self=this;
  315. (self['@current']=anHandler);
  316. return self;},
  317. args: ["anHandler"],
  318. source: unescape('setCurrent%3A%20anHandler%0A%09current%20%3A%3D%20anHandler'),
  319. messageSends: [],
  320. referencedClasses: []
  321. }),
  322. smalltalk.ErrorHandler.klass);