1
0

Kernel-Exceptions.deploy.js 13 KB

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