2
0

Kernel-Exceptions.deploy.js 13 KB

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