Kernel-Exceptions.deploy.js 13 KB

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