2
0

Kernel-Exceptions.deploy.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. smalltalk.addPackage('Kernel-Exceptions');
  2. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "context",
  6. fn: function (){
  7. var self=this;
  8. return smalltalk.withContext(function($ctx1) {
  9. return self.context;
  10. return self}, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.Error)})},
  11. messageSends: []}),
  12. smalltalk.Error);
  13. smalltalk.addMethod(
  14. smalltalk.method({
  15. selector: "initialize",
  16. fn: function (){
  17. var self=this;
  18. return smalltalk.withContext(function($ctx1) {
  19. self._messageText_("Errorclass: ".__comma(_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. smalltalk.method({
  25. selector: "isSmalltalkError",
  26. fn: function (){
  27. var self=this;
  28. return smalltalk.withContext(function($ctx1) {
  29. return self.smalltalkError === true;
  30. return self}, function($ctx1) {$ctx1.fill(self,"isSmalltalkError",{},smalltalk.Error)})},
  31. messageSends: []}),
  32. smalltalk.Error);
  33. smalltalk.addMethod(
  34. smalltalk.method({
  35. selector: "jsStack",
  36. fn: function (){
  37. var self=this;
  38. return smalltalk.withContext(function($ctx1) {
  39. return self.stack;
  40. return self}, function($ctx1) {$ctx1.fill(self,"jsStack",{},smalltalk.Error)})},
  41. messageSends: []}),
  42. smalltalk.Error);
  43. smalltalk.addMethod(
  44. smalltalk.method({
  45. selector: "messageText",
  46. fn: function (){
  47. var self=this;
  48. return smalltalk.withContext(function($ctx1) {
  49. 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. smalltalk.method({
  57. selector: "messageText:",
  58. fn: function (aString){
  59. var self=this;
  60. return smalltalk.withContext(function($ctx1) {
  61. 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. smalltalk.method({
  67. selector: "resignal",
  68. fn: function (){
  69. var self=this;
  70. return smalltalk.withContext(function($ctx1) {
  71. throw(self);
  72. return self}, function($ctx1) {$ctx1.fill(self,"resignal",{},smalltalk.Error)})},
  73. messageSends: []}),
  74. smalltalk.Error);
  75. smalltalk.addMethod(
  76. smalltalk.method({
  77. selector: "signal",
  78. fn: function (){
  79. var self=this;
  80. return smalltalk.withContext(function($ctx1) {
  81. self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
  82. return self}, function($ctx1) {$ctx1.fill(self,"signal",{},smalltalk.Error)})},
  83. messageSends: []}),
  84. smalltalk.Error);
  85. smalltalk.addMethod(
  86. smalltalk.method({
  87. selector: "signal:",
  88. fn: function (aString){
  89. var self=this;
  90. return smalltalk.withContext(function($ctx1) {
  91. self._messageText_(aString);
  92. self._signal();
  93. return self}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.Error)})},
  94. messageSends: ["messageText:", "signal"]}),
  95. smalltalk.Error);
  96. smalltalk.addMethod(
  97. smalltalk.method({
  98. selector: "heliosClass",
  99. fn: function (){
  100. var self=this;
  101. return smalltalk.withContext(function($ctx1) {
  102. return "exception";
  103. }, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Error.klass)})},
  104. messageSends: []}),
  105. smalltalk.Error.klass);
  106. smalltalk.addMethod(
  107. smalltalk.method({
  108. selector: "signal",
  109. fn: function (){
  110. var self=this;
  111. return smalltalk.withContext(function($ctx1) {
  112. var $1;
  113. $1=_st(self._new())._signal();
  114. return $1;
  115. }, function($ctx1) {$ctx1.fill(self,"signal",{},smalltalk.Error.klass)})},
  116. messageSends: ["signal", "new"]}),
  117. smalltalk.Error.klass);
  118. smalltalk.addMethod(
  119. smalltalk.method({
  120. selector: "signal:",
  121. fn: function (aString){
  122. var self=this;
  123. return smalltalk.withContext(function($ctx1) {
  124. var $1;
  125. $1=_st(self._new())._signal_(aString);
  126. return $1;
  127. }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.Error.klass)})},
  128. messageSends: ["signal:", "new"]}),
  129. smalltalk.Error.klass);
  130. smalltalk.addClass('JavaScriptException', smalltalk.Error, ['exception'], 'Kernel-Exceptions');
  131. smalltalk.addMethod(
  132. smalltalk.method({
  133. selector: "context:",
  134. fn: function (aMethodContext){
  135. var self=this;
  136. return smalltalk.withContext(function($ctx1) {
  137. self.context = aMethodContext;
  138. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext},smalltalk.JavaScriptException)})},
  139. messageSends: []}),
  140. smalltalk.JavaScriptException);
  141. smalltalk.addMethod(
  142. smalltalk.method({
  143. selector: "exception",
  144. fn: function (){
  145. var self=this;
  146. return smalltalk.withContext(function($ctx1) {
  147. var $1;
  148. $1=self["@exception"];
  149. return $1;
  150. }, function($ctx1) {$ctx1.fill(self,"exception",{},smalltalk.JavaScriptException)})},
  151. messageSends: []}),
  152. smalltalk.JavaScriptException);
  153. smalltalk.addMethod(
  154. smalltalk.method({
  155. selector: "exception:",
  156. fn: function (anException){
  157. var self=this;
  158. return smalltalk.withContext(function($ctx1) {
  159. self["@exception"]=anException;
  160. return self}, function($ctx1) {$ctx1.fill(self,"exception:",{anException:anException},smalltalk.JavaScriptException)})},
  161. messageSends: []}),
  162. smalltalk.JavaScriptException);
  163. smalltalk.addMethod(
  164. smalltalk.method({
  165. selector: "messageText",
  166. fn: function (){
  167. var self=this;
  168. return smalltalk.withContext(function($ctx1) {
  169. return 'JavaScript exception: ' + self["@exception"].toString();
  170. return self}, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.JavaScriptException)})},
  171. messageSends: []}),
  172. smalltalk.JavaScriptException);
  173. smalltalk.addMethod(
  174. smalltalk.method({
  175. selector: "on:",
  176. fn: function (anException){
  177. var self=this;
  178. return smalltalk.withContext(function($ctx1) {
  179. var $2,$3,$1;
  180. $2=self._new();
  181. _st($2)._exception_(anException);
  182. $3=_st($2)._yourself();
  183. $1=$3;
  184. return $1;
  185. }, function($ctx1) {$ctx1.fill(self,"on:",{anException:anException},smalltalk.JavaScriptException.klass)})},
  186. messageSends: ["exception:", "new", "yourself"]}),
  187. smalltalk.JavaScriptException.klass);
  188. smalltalk.addMethod(
  189. smalltalk.method({
  190. selector: "on:context:",
  191. fn: function (anException,aMethodContext){
  192. var self=this;
  193. return smalltalk.withContext(function($ctx1) {
  194. var $2,$3,$1;
  195. $2=self._new();
  196. _st($2)._exception_(anException);
  197. _st($2)._context_(aMethodContext);
  198. $3=_st($2)._yourself();
  199. $1=$3;
  200. return $1;
  201. }, function($ctx1) {$ctx1.fill(self,"on:context:",{anException:anException,aMethodContext:aMethodContext},smalltalk.JavaScriptException.klass)})},
  202. messageSends: ["exception:", "new", "context:", "yourself"]}),
  203. smalltalk.JavaScriptException.klass);
  204. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel-Exceptions');
  205. smalltalk.addMethod(
  206. smalltalk.method({
  207. selector: "message",
  208. fn: function (){
  209. var self=this;
  210. return smalltalk.withContext(function($ctx1) {
  211. var $1;
  212. $1=self["@message"];
  213. return $1;
  214. }, function($ctx1) {$ctx1.fill(self,"message",{},smalltalk.MessageNotUnderstood)})},
  215. messageSends: []}),
  216. smalltalk.MessageNotUnderstood);
  217. smalltalk.addMethod(
  218. smalltalk.method({
  219. selector: "message:",
  220. fn: function (aMessage){
  221. var self=this;
  222. return smalltalk.withContext(function($ctx1) {
  223. self["@message"]=aMessage;
  224. return self}, function($ctx1) {$ctx1.fill(self,"message:",{aMessage:aMessage},smalltalk.MessageNotUnderstood)})},
  225. messageSends: []}),
  226. smalltalk.MessageNotUnderstood);
  227. smalltalk.addMethod(
  228. smalltalk.method({
  229. selector: "messageText",
  230. fn: function (){
  231. var self=this;
  232. return smalltalk.withContext(function($ctx1) {
  233. var $1;
  234. $1=_st(_st(_st(self._receiver())._asString()).__comma(" does not understand #")).__comma(_st(self._message())._selector());
  235. return $1;
  236. }, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.MessageNotUnderstood)})},
  237. messageSends: [",", "selector", "message", "asString", "receiver"]}),
  238. smalltalk.MessageNotUnderstood);
  239. smalltalk.addMethod(
  240. smalltalk.method({
  241. selector: "receiver",
  242. fn: function (){
  243. var self=this;
  244. return smalltalk.withContext(function($ctx1) {
  245. var $1;
  246. $1=self["@receiver"];
  247. return $1;
  248. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.MessageNotUnderstood)})},
  249. messageSends: []}),
  250. smalltalk.MessageNotUnderstood);
  251. smalltalk.addMethod(
  252. smalltalk.method({
  253. selector: "receiver:",
  254. fn: function (anObject){
  255. var self=this;
  256. return smalltalk.withContext(function($ctx1) {
  257. self["@receiver"]=anObject;
  258. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.MessageNotUnderstood)})},
  259. messageSends: []}),
  260. smalltalk.MessageNotUnderstood);
  261. smalltalk.addClass('NonBooleanReceiver', smalltalk.Error, ['object'], 'Kernel-Exceptions');
  262. smalltalk.addMethod(
  263. smalltalk.method({
  264. selector: "object",
  265. fn: function (){
  266. var self=this;
  267. return smalltalk.withContext(function($ctx1) {
  268. var $1;
  269. $1=self["@object"];
  270. return $1;
  271. }, function($ctx1) {$ctx1.fill(self,"object",{},smalltalk.NonBooleanReceiver)})},
  272. messageSends: []}),
  273. smalltalk.NonBooleanReceiver);
  274. smalltalk.addMethod(
  275. smalltalk.method({
  276. selector: "object:",
  277. fn: function (anObject){
  278. var self=this;
  279. return smalltalk.withContext(function($ctx1) {
  280. self["@object"]=anObject;
  281. return self}, function($ctx1) {$ctx1.fill(self,"object:",{anObject:anObject},smalltalk.NonBooleanReceiver)})},
  282. messageSends: []}),
  283. smalltalk.NonBooleanReceiver);
  284. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel-Exceptions');
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "handleError:",
  288. fn: function (anError){
  289. var self=this;
  290. return smalltalk.withContext(function($ctx1) {
  291. var $1;
  292. $1=_st(anError)._context();
  293. if(($receiver = $1) == nil || $receiver == undefined){
  294. $1;
  295. } else {
  296. self._logErrorContext_(_st(anError)._context());
  297. };
  298. self._logError_(anError);
  299. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.ErrorHandler)})},
  300. messageSends: ["ifNotNil:", "logErrorContext:", "context", "logError:"]}),
  301. smalltalk.ErrorHandler);
  302. smalltalk.addMethod(
  303. smalltalk.method({
  304. selector: "log:",
  305. fn: function (aString){
  306. var self=this;
  307. return smalltalk.withContext(function($ctx1) {
  308. _st(console)._log_(aString);
  309. return self}, function($ctx1) {$ctx1.fill(self,"log:",{aString:aString},smalltalk.ErrorHandler)})},
  310. messageSends: ["log:"]}),
  311. smalltalk.ErrorHandler);
  312. smalltalk.addMethod(
  313. smalltalk.method({
  314. selector: "logContext:",
  315. fn: function (aContext){
  316. var self=this;
  317. return smalltalk.withContext(function($ctx1) {
  318. var $1;
  319. $1=_st(aContext)._home();
  320. if(($receiver = $1) == nil || $receiver == undefined){
  321. $1;
  322. } else {
  323. self._logContext_(_st(aContext)._home());
  324. };
  325. self._log_(_st(aContext)._asString());
  326. return self}, function($ctx1) {$ctx1.fill(self,"logContext:",{aContext:aContext},smalltalk.ErrorHandler)})},
  327. messageSends: ["ifNotNil:", "logContext:", "home", "log:", "asString"]}),
  328. smalltalk.ErrorHandler);
  329. smalltalk.addMethod(
  330. smalltalk.method({
  331. selector: "logError:",
  332. fn: function (anError){
  333. var self=this;
  334. return smalltalk.withContext(function($ctx1) {
  335. self._log_(_st(anError)._messageText());
  336. return self}, function($ctx1) {$ctx1.fill(self,"logError:",{anError:anError},smalltalk.ErrorHandler)})},
  337. messageSends: ["log:", "messageText"]}),
  338. smalltalk.ErrorHandler);
  339. smalltalk.addMethod(
  340. smalltalk.method({
  341. selector: "logErrorContext:",
  342. fn: function (aContext){
  343. var self=this;
  344. return smalltalk.withContext(function($ctx1) {
  345. var $1,$2;
  346. $1=aContext;
  347. if(($receiver = $1) == nil || $receiver == undefined){
  348. $1;
  349. } else {
  350. $2=_st(aContext)._home();
  351. if(($receiver = $2) == nil || $receiver == undefined){
  352. $2;
  353. } else {
  354. self._logContext_(_st(aContext)._home());
  355. };
  356. };
  357. return self}, function($ctx1) {$ctx1.fill(self,"logErrorContext:",{aContext:aContext},smalltalk.ErrorHandler)})},
  358. messageSends: ["ifNotNil:", "logContext:", "home"]}),
  359. smalltalk.ErrorHandler);
  360. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  361. smalltalk.addMethod(
  362. smalltalk.method({
  363. selector: "current",
  364. fn: function (){
  365. var self=this;
  366. return smalltalk.withContext(function($ctx1) {
  367. var $2,$1;
  368. $2=self["@current"];
  369. if(($receiver = $2) == nil || $receiver == undefined){
  370. self["@current"]=self._new();
  371. $1=self["@current"];
  372. } else {
  373. $1=$2;
  374. };
  375. return $1;
  376. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.ErrorHandler.klass)})},
  377. messageSends: ["ifNil:", "new"]}),
  378. smalltalk.ErrorHandler.klass);
  379. smalltalk.addMethod(
  380. smalltalk.method({
  381. selector: "initialize",
  382. fn: function (){
  383. var self=this;
  384. return smalltalk.withContext(function($ctx1) {
  385. self._register();
  386. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ErrorHandler.klass)})},
  387. messageSends: ["register"]}),
  388. smalltalk.ErrorHandler.klass);
  389. smalltalk.addMethod(
  390. smalltalk.method({
  391. selector: "register",
  392. fn: function (){
  393. var self=this;
  394. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  395. return smalltalk.withContext(function($ctx1) {
  396. _st($ErrorHandler())._setCurrent_(self._new());
  397. return self}, function($ctx1) {$ctx1.fill(self,"register",{},smalltalk.ErrorHandler.klass)})},
  398. messageSends: ["setCurrent:", "new"]}),
  399. smalltalk.ErrorHandler.klass);
  400. smalltalk.addMethod(
  401. smalltalk.method({
  402. selector: "setCurrent:",
  403. fn: function (anHandler){
  404. var self=this;
  405. return smalltalk.withContext(function($ctx1) {
  406. self["@current"]=anHandler;
  407. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler},smalltalk.ErrorHandler.klass)})},
  408. messageSends: []}),
  409. smalltalk.ErrorHandler.klass);