Kernel-Exceptions.deploy.js 9.7 KB

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