1
0

Kernel-Exceptions.deploy.js 6.4 KB

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