2
0

Kernel-Exceptions.deploy.js 13 KB

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