Kernel-Exceptions.deploy.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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('JavaScriptException', smalltalk.Error, ['exception'], 'Kernel-Exceptions');
  111. smalltalk.addMethod(
  112. "_context_",
  113. smalltalk.method({
  114. selector: "context:",
  115. fn: function (aMethodContext){
  116. var self=this;
  117. return smalltalk.withContext(function($ctx1) { self.context = aMethodContext;
  118. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext}, smalltalk.JavaScriptException)})}
  119. }),
  120. smalltalk.JavaScriptException);
  121. smalltalk.addMethod(
  122. "_exception",
  123. smalltalk.method({
  124. selector: "exception",
  125. fn: function (){
  126. var self=this;
  127. return smalltalk.withContext(function($ctx1) { var $1;
  128. $1=self["@exception"];
  129. return $1;
  130. }, function($ctx1) {$ctx1.fill(self,"exception",{}, smalltalk.JavaScriptException)})}
  131. }),
  132. smalltalk.JavaScriptException);
  133. smalltalk.addMethod(
  134. "_exception_",
  135. smalltalk.method({
  136. selector: "exception:",
  137. fn: function (anException){
  138. var self=this;
  139. return smalltalk.withContext(function($ctx1) { _st(anException)._messageText_(_st(anException)._basicAt_("message"));
  140. self["@exception"]=anException;
  141. return self}, function($ctx1) {$ctx1.fill(self,"exception:",{anException:anException}, smalltalk.JavaScriptException)})}
  142. }),
  143. smalltalk.JavaScriptException);
  144. smalltalk.addMethod(
  145. "_messageText",
  146. smalltalk.method({
  147. selector: "messageText",
  148. fn: function (){
  149. var self=this;
  150. return smalltalk.withContext(function($ctx1) { var $1;
  151. $1=_st("JavaScript exception: ").__comma(_st(_st(self)._exception())._messageText());
  152. return $1;
  153. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.JavaScriptException)})}
  154. }),
  155. smalltalk.JavaScriptException);
  156. smalltalk.addMethod(
  157. "_on_",
  158. smalltalk.method({
  159. selector: "on:",
  160. fn: function (anException){
  161. var self=this;
  162. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  163. $2=_st(self)._new();
  164. _st($2)._exception_(anException);
  165. $3=_st($2)._yourself();
  166. $1=$3;
  167. return $1;
  168. }, function($ctx1) {$ctx1.fill(self,"on:",{anException:anException}, smalltalk.JavaScriptException.klass)})}
  169. }),
  170. smalltalk.JavaScriptException.klass);
  171. smalltalk.addMethod(
  172. "_on_context_",
  173. smalltalk.method({
  174. selector: "on:context:",
  175. fn: function (anException,aMethodContext){
  176. var self=this;
  177. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  178. $2=_st(self)._new();
  179. _st($2)._exception_(anException);
  180. _st($2)._context_(aMethodContext);
  181. $3=_st($2)._yourself();
  182. $1=$3;
  183. return $1;
  184. }, function($ctx1) {$ctx1.fill(self,"on:context:",{anException:anException,aMethodContext:aMethodContext}, smalltalk.JavaScriptException.klass)})}
  185. }),
  186. smalltalk.JavaScriptException.klass);
  187. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel-Exceptions');
  188. smalltalk.addMethod(
  189. "_message",
  190. smalltalk.method({
  191. selector: "message",
  192. fn: function (){
  193. var self=this;
  194. return smalltalk.withContext(function($ctx1) { var $1;
  195. $1=self["@message"];
  196. return $1;
  197. }, function($ctx1) {$ctx1.fill(self,"message",{}, smalltalk.MessageNotUnderstood)})}
  198. }),
  199. smalltalk.MessageNotUnderstood);
  200. smalltalk.addMethod(
  201. "_message_",
  202. smalltalk.method({
  203. selector: "message:",
  204. fn: function (aMessage){
  205. var self=this;
  206. return smalltalk.withContext(function($ctx1) { self["@message"]=aMessage;
  207. return self}, function($ctx1) {$ctx1.fill(self,"message:",{aMessage:aMessage}, smalltalk.MessageNotUnderstood)})}
  208. }),
  209. smalltalk.MessageNotUnderstood);
  210. smalltalk.addMethod(
  211. "_messageText",
  212. smalltalk.method({
  213. selector: "messageText",
  214. fn: function (){
  215. var self=this;
  216. return smalltalk.withContext(function($ctx1) { var $1;
  217. $1=_st(_st(_st(_st(self)._receiver())._asString()).__comma(" does not understand #")).__comma(_st(_st(self)._message())._selector());
  218. return $1;
  219. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.MessageNotUnderstood)})}
  220. }),
  221. smalltalk.MessageNotUnderstood);
  222. smalltalk.addMethod(
  223. "_receiver",
  224. smalltalk.method({
  225. selector: "receiver",
  226. fn: function (){
  227. var self=this;
  228. return smalltalk.withContext(function($ctx1) { var $1;
  229. $1=self["@receiver"];
  230. return $1;
  231. }, function($ctx1) {$ctx1.fill(self,"receiver",{}, smalltalk.MessageNotUnderstood)})}
  232. }),
  233. smalltalk.MessageNotUnderstood);
  234. smalltalk.addMethod(
  235. "_receiver_",
  236. smalltalk.method({
  237. selector: "receiver:",
  238. fn: function (anObject){
  239. var self=this;
  240. return smalltalk.withContext(function($ctx1) { self["@receiver"]=anObject;
  241. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject}, smalltalk.MessageNotUnderstood)})}
  242. }),
  243. smalltalk.MessageNotUnderstood);
  244. smalltalk.addClass('NonBooleanReceiver', smalltalk.Error, ['object'], 'Kernel-Exceptions');
  245. smalltalk.addMethod(
  246. "_object",
  247. smalltalk.method({
  248. selector: "object",
  249. fn: function (){
  250. var self=this;
  251. return smalltalk.withContext(function($ctx1) { var $1;
  252. $1=self["@object"];
  253. return $1;
  254. }, function($ctx1) {$ctx1.fill(self,"object",{}, smalltalk.NonBooleanReceiver)})}
  255. }),
  256. smalltalk.NonBooleanReceiver);
  257. smalltalk.addMethod(
  258. "_object_",
  259. smalltalk.method({
  260. selector: "object:",
  261. fn: function (anObject){
  262. var self=this;
  263. return smalltalk.withContext(function($ctx1) { self["@object"]=anObject;
  264. return self}, function($ctx1) {$ctx1.fill(self,"object:",{anObject:anObject}, smalltalk.NonBooleanReceiver)})}
  265. }),
  266. smalltalk.NonBooleanReceiver);
  267. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel-Exceptions');
  268. smalltalk.addMethod(
  269. "_handleError_",
  270. smalltalk.method({
  271. selector: "handleError:",
  272. fn: function (anError){
  273. var self=this;
  274. return smalltalk.withContext(function($ctx1) { var $1;
  275. $1=_st(anError)._context();
  276. if(($receiver = $1) == nil || $receiver == undefined){
  277. $1;
  278. } else {
  279. _st(self)._logErrorContext_(_st(anError)._context());
  280. };
  281. _st(self)._logError_(anError);
  282. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError}, smalltalk.ErrorHandler)})}
  283. }),
  284. smalltalk.ErrorHandler);
  285. smalltalk.addMethod(
  286. "_log_",
  287. smalltalk.method({
  288. selector: "log:",
  289. fn: function (aString){
  290. var self=this;
  291. return smalltalk.withContext(function($ctx1) { _st(console)._log_(aString);
  292. return self}, function($ctx1) {$ctx1.fill(self,"log:",{aString:aString}, smalltalk.ErrorHandler)})}
  293. }),
  294. smalltalk.ErrorHandler);
  295. smalltalk.addMethod(
  296. "_logContext_",
  297. smalltalk.method({
  298. selector: "logContext:",
  299. fn: function (aContext){
  300. var self=this;
  301. return smalltalk.withContext(function($ctx1) { var $1;
  302. $1=_st(aContext)._home();
  303. if(($receiver = $1) == nil || $receiver == undefined){
  304. $1;
  305. } else {
  306. _st(self)._logContext_(_st(aContext)._home());
  307. };
  308. _st(self)._log_(_st(_st(_st(_st(aContext)._receiver())._asString()).__comma(">>")).__comma(_st(_st(aContext)._selector())._asString()));
  309. return self}, function($ctx1) {$ctx1.fill(self,"logContext:",{aContext:aContext}, smalltalk.ErrorHandler)})}
  310. }),
  311. smalltalk.ErrorHandler);
  312. smalltalk.addMethod(
  313. "_logError_",
  314. smalltalk.method({
  315. selector: "logError:",
  316. fn: function (anError){
  317. var self=this;
  318. return smalltalk.withContext(function($ctx1) { _st(self)._log_(_st(anError)._messageText());
  319. return self}, function($ctx1) {$ctx1.fill(self,"logError:",{anError:anError}, smalltalk.ErrorHandler)})}
  320. }),
  321. smalltalk.ErrorHandler);
  322. smalltalk.addMethod(
  323. "_logErrorContext_",
  324. smalltalk.method({
  325. selector: "logErrorContext:",
  326. fn: function (aContext){
  327. var self=this;
  328. return smalltalk.withContext(function($ctx1) { var $1,$3,$2;
  329. $1=aContext;
  330. $2=(function(){
  331. return smalltalk.withContext(function($ctx2) { $3=_st(aContext)._home();
  332. if(($receiver = $3) == nil || $receiver == undefined){
  333. return $3;
  334. } else {
  335. return _st(self)._logContext_(_st(aContext)._home());
  336. };
  337. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  338. _st($1)._ifNotNil_($2);
  339. return self}, function($ctx1) {$ctx1.fill(self,"logErrorContext:",{aContext:aContext}, smalltalk.ErrorHandler)})}
  340. }),
  341. smalltalk.ErrorHandler);
  342. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  343. smalltalk.addMethod(
  344. "_current",
  345. smalltalk.method({
  346. selector: "current",
  347. fn: function (){
  348. var self=this;
  349. return smalltalk.withContext(function($ctx1) { var $2,$1;
  350. $2=self["@current"];
  351. if(($receiver = $2) == nil || $receiver == undefined){
  352. self["@current"]=_st(self)._new();
  353. $1=self["@current"];
  354. } else {
  355. $1=$2;
  356. };
  357. return $1;
  358. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.ErrorHandler.klass)})}
  359. }),
  360. smalltalk.ErrorHandler.klass);
  361. smalltalk.addMethod(
  362. "_initialize",
  363. smalltalk.method({
  364. selector: "initialize",
  365. fn: function (){
  366. var self=this;
  367. return smalltalk.withContext(function($ctx1) { _st(self)._register();
  368. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ErrorHandler.klass)})}
  369. }),
  370. smalltalk.ErrorHandler.klass);
  371. smalltalk.addMethod(
  372. "_register",
  373. smalltalk.method({
  374. selector: "register",
  375. fn: function (){
  376. var self=this;
  377. return smalltalk.withContext(function($ctx1) { _st((smalltalk.ErrorHandler || ErrorHandler))._setCurrent_(_st(self)._new());
  378. return self}, function($ctx1) {$ctx1.fill(self,"register",{}, smalltalk.ErrorHandler.klass)})}
  379. }),
  380. smalltalk.ErrorHandler.klass);
  381. smalltalk.addMethod(
  382. "_setCurrent_",
  383. smalltalk.method({
  384. selector: "setCurrent:",
  385. fn: function (anHandler){
  386. var self=this;
  387. return smalltalk.withContext(function($ctx1) { self["@current"]=anHandler;
  388. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler}, smalltalk.ErrorHandler.klass)})}
  389. }),
  390. smalltalk.ErrorHandler.klass);