Kernel-Exceptions.deploy.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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: "signal",
  89. fn: function (){
  90. var self=this;
  91. return smalltalk.withContext(function($ctx1) {
  92. 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. smalltalk.method({
  100. selector: "signal:",
  101. fn: function (aString){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) {
  104. 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. smalltalk.method({
  113. selector: "context:",
  114. fn: function (aMethodContext){
  115. var self=this;
  116. return smalltalk.withContext(function($ctx1) {
  117. 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. smalltalk.method({
  123. selector: "exception",
  124. fn: function (){
  125. var self=this;
  126. return smalltalk.withContext(function($ctx1) {
  127. 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. smalltalk.method({
  135. selector: "exception:",
  136. fn: function (anException){
  137. var self=this;
  138. return smalltalk.withContext(function($ctx1) {
  139. 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. smalltalk.method({
  145. selector: "messageText",
  146. fn: function (){
  147. var self=this;
  148. return smalltalk.withContext(function($ctx1) {
  149. 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. smalltalk.method({
  155. selector: "on:",
  156. fn: function (anException){
  157. var self=this;
  158. return smalltalk.withContext(function($ctx1) {
  159. 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. smalltalk.method({
  170. selector: "on:context:",
  171. fn: function (anException,aMethodContext){
  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. _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. smalltalk.method({
  187. selector: "message",
  188. fn: function (){
  189. var self=this;
  190. return smalltalk.withContext(function($ctx1) {
  191. 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. smalltalk.method({
  199. selector: "message:",
  200. fn: function (aMessage){
  201. var self=this;
  202. return smalltalk.withContext(function($ctx1) {
  203. 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. smalltalk.method({
  209. selector: "messageText",
  210. fn: function (){
  211. var self=this;
  212. return smalltalk.withContext(function($ctx1) {
  213. 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. smalltalk.method({
  221. selector: "receiver",
  222. fn: function (){
  223. var self=this;
  224. return smalltalk.withContext(function($ctx1) {
  225. 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. smalltalk.method({
  233. selector: "receiver:",
  234. fn: function (anObject){
  235. var self=this;
  236. return smalltalk.withContext(function($ctx1) {
  237. 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. smalltalk.method({
  244. selector: "object",
  245. fn: function (){
  246. var self=this;
  247. return smalltalk.withContext(function($ctx1) {
  248. 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. smalltalk.method({
  256. selector: "object:",
  257. fn: function (anObject){
  258. var self=this;
  259. return smalltalk.withContext(function($ctx1) {
  260. 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. smalltalk.method({
  267. selector: "handleError:",
  268. fn: function (anError){
  269. var self=this;
  270. return smalltalk.withContext(function($ctx1) {
  271. 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. smalltalk.method({
  284. selector: "log:",
  285. fn: function (aString){
  286. var self=this;
  287. return smalltalk.withContext(function($ctx1) {
  288. _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. smalltalk.method({
  294. selector: "logContext:",
  295. fn: function (aContext){
  296. var self=this;
  297. return smalltalk.withContext(function($ctx1) {
  298. 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. smalltalk.method({
  311. selector: "logError:",
  312. fn: function (anError){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx1) {
  315. _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. smalltalk.method({
  321. selector: "logErrorContext:",
  322. fn: function (aContext){
  323. var self=this;
  324. return smalltalk.withContext(function($ctx1) {
  325. 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. smalltalk.method({
  343. selector: "current",
  344. fn: function (){
  345. var self=this;
  346. return smalltalk.withContext(function($ctx1) {
  347. 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. smalltalk.method({
  361. selector: "initialize",
  362. fn: function (){
  363. var self=this;
  364. return smalltalk.withContext(function($ctx1) {
  365. _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. smalltalk.method({
  371. selector: "register",
  372. fn: function (){
  373. var self=this;
  374. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  375. return smalltalk.withContext(function($ctx1) {
  376. _st($ErrorHandler())._setCurrent_(_st(self)._new());
  377. return self}, function($ctx1) {$ctx1.fill(self,"register",{},smalltalk.ErrorHandler.klass)})},
  378. messageSends: ["setCurrent:", "new"]}),
  379. smalltalk.ErrorHandler.klass);
  380. smalltalk.addMethod(
  381. smalltalk.method({
  382. selector: "setCurrent:",
  383. fn: function (anHandler){
  384. var self=this;
  385. return smalltalk.withContext(function($ctx1) {
  386. self["@current"]=anHandler;
  387. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler},smalltalk.ErrorHandler.klass)})},
  388. messageSends: []}),
  389. smalltalk.ErrorHandler.klass);