2
0

Kernel-Exceptions.deploy.js 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. smalltalk.addPackage('Kernel-Exceptions', {});
  2. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
  3. smalltalk.addMethod(
  4. unescape('_context'),
  5. smalltalk.method({
  6. selector: unescape('context'),
  7. fn: function (){
  8. var self=this;
  9. return self.context;
  10. return self;}
  11. }),
  12. smalltalk.Error);
  13. smalltalk.addMethod(
  14. unescape('_isSmalltalkError'),
  15. smalltalk.method({
  16. selector: unescape('isSmalltalkError'),
  17. fn: function (){
  18. var self=this;
  19. return self.smalltalkError === true;
  20. return self;}
  21. }),
  22. smalltalk.Error);
  23. smalltalk.addMethod(
  24. unescape('_jsStack'),
  25. smalltalk.method({
  26. selector: unescape('jsStack'),
  27. fn: function (){
  28. var self=this;
  29. return self.stack;
  30. return self;}
  31. }),
  32. smalltalk.Error);
  33. smalltalk.addMethod(
  34. unescape('_messageText'),
  35. smalltalk.method({
  36. selector: unescape('messageText'),
  37. fn: function (){
  38. var self=this;
  39. return self['@messageText'];
  40. return self;}
  41. }),
  42. smalltalk.Error);
  43. smalltalk.addMethod(
  44. unescape('_messageText_'),
  45. smalltalk.method({
  46. selector: unescape('messageText%3A'),
  47. fn: function (aString){
  48. var self=this;
  49. (self['@messageText']=aString);
  50. return self;}
  51. }),
  52. smalltalk.Error);
  53. smalltalk.addMethod(
  54. unescape('_signal'),
  55. smalltalk.method({
  56. selector: unescape('signal'),
  57. fn: function (){
  58. var self=this;
  59. self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
  60. return self;}
  61. }),
  62. smalltalk.Error);
  63. smalltalk.addMethod(
  64. unescape('_signal_'),
  65. smalltalk.method({
  66. selector: unescape('signal%3A'),
  67. fn: function (aString){
  68. var self=this;
  69. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  70. return self;}
  71. }),
  72. smalltalk.Error.klass);
  73. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel-Exceptions');
  74. smalltalk.addMethod(
  75. unescape('_message'),
  76. smalltalk.method({
  77. selector: unescape('message'),
  78. fn: function (){
  79. var self=this;
  80. return self['@message'];
  81. return self;}
  82. }),
  83. smalltalk.MessageNotUnderstood);
  84. smalltalk.addMethod(
  85. unescape('_message_'),
  86. smalltalk.method({
  87. selector: unescape('message%3A'),
  88. fn: function (aMessage){
  89. var self=this;
  90. (self['@message']=aMessage);
  91. return self;}
  92. }),
  93. smalltalk.MessageNotUnderstood);
  94. smalltalk.addMethod(
  95. unescape('_messageText'),
  96. smalltalk.method({
  97. selector: unescape('messageText'),
  98. fn: function (){
  99. var self=this;
  100. 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", [])]);
  101. return self;}
  102. }),
  103. smalltalk.MessageNotUnderstood);
  104. smalltalk.addMethod(
  105. unescape('_receiver'),
  106. smalltalk.method({
  107. selector: unescape('receiver'),
  108. fn: function (){
  109. var self=this;
  110. return self['@receiver'];
  111. return self;}
  112. }),
  113. smalltalk.MessageNotUnderstood);
  114. smalltalk.addMethod(
  115. unescape('_receiver_'),
  116. smalltalk.method({
  117. selector: unescape('receiver%3A'),
  118. fn: function (anObject){
  119. var self=this;
  120. (self['@receiver']=anObject);
  121. return self;}
  122. }),
  123. smalltalk.MessageNotUnderstood);
  124. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel-Exceptions');
  125. smalltalk.addMethod(
  126. unescape('_handleError_'),
  127. smalltalk.method({
  128. selector: unescape('handleError%3A'),
  129. fn: function (anError){
  130. var self=this;
  131. (($receiver = smalltalk.send(anError, "_context", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})() : nil;
  132. smalltalk.send(self, "_logError_", [anError]);
  133. return self;}
  134. }),
  135. smalltalk.ErrorHandler);
  136. smalltalk.addMethod(
  137. unescape('_log_'),
  138. smalltalk.method({
  139. selector: unescape('log%3A'),
  140. fn: function (aString){
  141. var self=this;
  142. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [aString]);
  143. return self;}
  144. }),
  145. smalltalk.ErrorHandler);
  146. smalltalk.addMethod(
  147. unescape('_logContext_'),
  148. smalltalk.method({
  149. selector: unescape('logContext%3A'),
  150. fn: function (aContext){
  151. var self=this;
  152. (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;
  153. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  154. return self;}
  155. }),
  156. smalltalk.ErrorHandler);
  157. smalltalk.addMethod(
  158. unescape('_logError_'),
  159. smalltalk.method({
  160. selector: unescape('logError%3A'),
  161. fn: function (anError){
  162. var self=this;
  163. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  164. return self;}
  165. }),
  166. smalltalk.ErrorHandler);
  167. smalltalk.addMethod(
  168. unescape('_logErrorContext_'),
  169. smalltalk.method({
  170. selector: unescape('logErrorContext%3A'),
  171. fn: function (aContext){
  172. var self=this;
  173. (($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;
  174. return self;}
  175. }),
  176. smalltalk.ErrorHandler);
  177. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  178. smalltalk.addMethod(
  179. unescape('_current'),
  180. smalltalk.method({
  181. selector: unescape('current'),
  182. fn: function (){
  183. var self=this;
  184. return (($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){return (self['@current']=smalltalk.send(self, "_new", []));})() : $receiver;
  185. return self;}
  186. }),
  187. smalltalk.ErrorHandler.klass);
  188. smalltalk.addMethod(
  189. unescape('_initialize'),
  190. smalltalk.method({
  191. selector: unescape('initialize'),
  192. fn: function (){
  193. var self=this;
  194. smalltalk.send(self, "_register", []);
  195. return self;}
  196. }),
  197. smalltalk.ErrorHandler.klass);
  198. smalltalk.addMethod(
  199. unescape('_register'),
  200. smalltalk.method({
  201. selector: unescape('register'),
  202. fn: function (){
  203. var self=this;
  204. smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  205. return self;}
  206. }),
  207. smalltalk.ErrorHandler.klass);
  208. smalltalk.addMethod(
  209. unescape('_setCurrent_'),
  210. smalltalk.method({
  211. selector: unescape('setCurrent%3A'),
  212. fn: function (anHandler){
  213. var self=this;
  214. (self['@current']=anHandler);
  215. return self;}
  216. }),
  217. smalltalk.ErrorHandler.klass);