Kernel-Exceptions.deploy.js 9.4 KB

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