Kernel-Objects.deploy.js 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823
  1. smalltalk.addPackage('Kernel-Objects', {});
  2. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
  3. smalltalk.addMethod(
  4. "__minus_gt",
  5. smalltalk.method({
  6. selector: "->",
  7. fn: function (anObject){
  8. var self=this;
  9. return smalltalk.send((smalltalk.Association || Association), "_key_value_", [self, anObject]);
  10. return self;}
  11. }),
  12. smalltalk.Object);
  13. smalltalk.addMethod(
  14. "__eq",
  15. smalltalk.method({
  16. selector: "=",
  17. fn: function (anObject){
  18. var self=this;
  19. return smalltalk.send(self, "__eq_eq", [anObject]);
  20. return self;}
  21. }),
  22. smalltalk.Object);
  23. smalltalk.addMethod(
  24. "__eq_eq",
  25. smalltalk.method({
  26. selector: "==",
  27. fn: function (anObject){
  28. var self=this;
  29. return smalltalk.send(smalltalk.send(self, "_identityHash", []), "__eq", [smalltalk.send(anObject, "_identityHash", [])]);
  30. return self;}
  31. }),
  32. smalltalk.Object);
  33. smalltalk.addMethod(
  34. "_asJSON",
  35. smalltalk.method({
  36. selector: "asJSON",
  37. fn: function (){
  38. var self=this;
  39. var variables=nil;
  40. (variables=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
  41. smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_allInstanceVariableNames", []), "_do_", [(function(each){return smalltalk.send(variables, "_at_put_", [each, smalltalk.send(smalltalk.send(self, "_instVarAt_", [each]), "_asJSON", [])]);})]);
  42. return variables;
  43. return self;}
  44. }),
  45. smalltalk.Object);
  46. smalltalk.addMethod(
  47. "_asJSONString",
  48. smalltalk.method({
  49. selector: "asJSONString",
  50. fn: function (){
  51. var self=this;
  52. return smalltalk.send((smalltalk.JSON || JSON), "_stringify_", [smalltalk.send(self, "_asJSON", [])]);
  53. return self;}
  54. }),
  55. smalltalk.Object);
  56. smalltalk.addMethod(
  57. "_asJavascript",
  58. smalltalk.method({
  59. selector: "asJavascript",
  60. fn: function (){
  61. var self=this;
  62. return smalltalk.send(self, "_asString", []);
  63. return self;}
  64. }),
  65. smalltalk.Object);
  66. smalltalk.addMethod(
  67. "_asString",
  68. smalltalk.method({
  69. selector: "asString",
  70. fn: function (){
  71. var self=this;
  72. return smalltalk.send(self, "_printString", []);
  73. return self;}
  74. }),
  75. smalltalk.Object);
  76. smalltalk.addMethod(
  77. "_basicAt_",
  78. smalltalk.method({
  79. selector: "basicAt:",
  80. fn: function (aString){
  81. var self=this;
  82. return self[aString];
  83. return self;}
  84. }),
  85. smalltalk.Object);
  86. smalltalk.addMethod(
  87. "_basicAt_put_",
  88. smalltalk.method({
  89. selector: "basicAt:put:",
  90. fn: function (aString, anObject){
  91. var self=this;
  92. return self[aString] = anObject;
  93. return self;}
  94. }),
  95. smalltalk.Object);
  96. smalltalk.addMethod(
  97. "_basicDelete_",
  98. smalltalk.method({
  99. selector: "basicDelete:",
  100. fn: function (aString){
  101. var self=this;
  102. delete self[aString]; return aString;
  103. return self;}
  104. }),
  105. smalltalk.Object);
  106. smalltalk.addMethod(
  107. "_basicPerform_",
  108. smalltalk.method({
  109. selector: "basicPerform:",
  110. fn: function (aSymbol){
  111. var self=this;
  112. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  113. return self;}
  114. }),
  115. smalltalk.Object);
  116. smalltalk.addMethod(
  117. "_basicPerform_withArguments_",
  118. smalltalk.method({
  119. selector: "basicPerform:withArguments:",
  120. fn: function (aSymbol, aCollection){
  121. var self=this;
  122. return self[aSymbol].apply(self, aCollection);;
  123. return self;}
  124. }),
  125. smalltalk.Object);
  126. smalltalk.addMethod(
  127. "_class",
  128. smalltalk.method({
  129. selector: "class",
  130. fn: function (){
  131. var self=this;
  132. return self.klass;
  133. return self;}
  134. }),
  135. smalltalk.Object);
  136. smalltalk.addMethod(
  137. "_copy",
  138. smalltalk.method({
  139. selector: "copy",
  140. fn: function (){
  141. var self=this;
  142. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  143. return self;}
  144. }),
  145. smalltalk.Object);
  146. smalltalk.addMethod(
  147. "_deepCopy",
  148. smalltalk.method({
  149. selector: "deepCopy",
  150. fn: function (){
  151. var self=this;
  152. var copy = self.klass._new();
  153. for(var i in self) {
  154. if(/^@.+/.test(i)) {
  155. copy[i] = self[i]._deepCopy();
  156. }
  157. }
  158. return copy;
  159. ;
  160. return self;}
  161. }),
  162. smalltalk.Object);
  163. smalltalk.addMethod(
  164. "_deprecatedAPI",
  165. smalltalk.method({
  166. selector: "deprecatedAPI",
  167. fn: function (){
  168. var self=this;
  169. smalltalk.send((typeof console == 'undefined' ? nil : console), "_warn_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.getThisContext()), "_home", []), "_asString", []), "__comma", [" is deprecated! (in "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.getThisContext()), "_home", []), "_home", []), "_asString", [])]), "__comma", [")"])]);
  170. return self;}
  171. }),
  172. smalltalk.Object);
  173. smalltalk.addMethod(
  174. "_doesNotUnderstand_",
  175. smalltalk.method({
  176. selector: "doesNotUnderstand:",
  177. fn: function (aMessage){
  178. var self=this;
  179. (function($rec){smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.MessageNotUnderstood || MessageNotUnderstood), "_new", []));
  180. return self;}
  181. }),
  182. smalltalk.Object);
  183. smalltalk.addMethod(
  184. "_error_",
  185. smalltalk.method({
  186. selector: "error:",
  187. fn: function (aString){
  188. var self=this;
  189. smalltalk.send((smalltalk.Error || Error), "_signal_", [aString]);
  190. return self;}
  191. }),
  192. smalltalk.Object);
  193. smalltalk.addMethod(
  194. "_halt",
  195. smalltalk.method({
  196. selector: "halt",
  197. fn: function (){
  198. var self=this;
  199. smalltalk.send(self, "_error_", ["Halt encountered"]);
  200. return self;}
  201. }),
  202. smalltalk.Object);
  203. smalltalk.addMethod(
  204. "_identityHash",
  205. smalltalk.method({
  206. selector: "identityHash",
  207. fn: function (){
  208. var self=this;
  209. var hash=self.identityHash;
  210. if (hash) return hash;
  211. hash=smalltalk.nextId();
  212. Object.defineProperty(self, 'identityHash', {value:hash});
  213. return hash;
  214. ;
  215. return self;}
  216. }),
  217. smalltalk.Object);
  218. smalltalk.addMethod(
  219. "_ifNil_",
  220. smalltalk.method({
  221. selector: "ifNil:",
  222. fn: function (aBlock){
  223. var self=this;
  224. return self;
  225. return self;}
  226. }),
  227. smalltalk.Object);
  228. smalltalk.addMethod(
  229. "_ifNil_ifNotNil_",
  230. smalltalk.method({
  231. selector: "ifNil:ifNotNil:",
  232. fn: function (aBlock, anotherBlock){
  233. var self=this;
  234. return smalltalk.send(anotherBlock, "_value", []);
  235. return self;}
  236. }),
  237. smalltalk.Object);
  238. smalltalk.addMethod(
  239. "_ifNotNil_",
  240. smalltalk.method({
  241. selector: "ifNotNil:",
  242. fn: function (aBlock){
  243. var self=this;
  244. return smalltalk.send(aBlock, "_value", []);
  245. return self;}
  246. }),
  247. smalltalk.Object);
  248. smalltalk.addMethod(
  249. "_ifNotNil_ifNil_",
  250. smalltalk.method({
  251. selector: "ifNotNil:ifNil:",
  252. fn: function (aBlock, anotherBlock){
  253. var self=this;
  254. return smalltalk.send(aBlock, "_value", []);
  255. return self;}
  256. }),
  257. smalltalk.Object);
  258. smalltalk.addMethod(
  259. "_initialize",
  260. smalltalk.method({
  261. selector: "initialize",
  262. fn: function (){
  263. var self=this;
  264. return self;}
  265. }),
  266. smalltalk.Object);
  267. smalltalk.addMethod(
  268. "_instVarAt_",
  269. smalltalk.method({
  270. selector: "instVarAt:",
  271. fn: function (aSymbol){
  272. var self=this;
  273. var varname=nil;
  274. (varname=smalltalk.send(aSymbol, "_asString", []));
  275. return self['@'+varname];
  276. return self;}
  277. }),
  278. smalltalk.Object);
  279. smalltalk.addMethod(
  280. "_instVarAt_put_",
  281. smalltalk.method({
  282. selector: "instVarAt:put:",
  283. fn: function (aSymbol, anObject){
  284. var self=this;
  285. var varname=nil;
  286. (varname=smalltalk.send(aSymbol, "_asString", []));
  287. self['@' + varname] = anObject;
  288. return self;}
  289. }),
  290. smalltalk.Object);
  291. smalltalk.addMethod(
  292. "_isClass",
  293. smalltalk.method({
  294. selector: "isClass",
  295. fn: function (){
  296. var self=this;
  297. return false;
  298. return self;}
  299. }),
  300. smalltalk.Object);
  301. smalltalk.addMethod(
  302. "_isKindOf_",
  303. smalltalk.method({
  304. selector: "isKindOf:",
  305. fn: function (aClass){
  306. var self=this;
  307. return ((($receiver = smalltalk.send(self, "_isMemberOf_", [aClass])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return true;})() : (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return true;}), (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})]));
  308. return self;}
  309. }),
  310. smalltalk.Object);
  311. smalltalk.addMethod(
  312. "_isMemberOf_",
  313. smalltalk.method({
  314. selector: "isMemberOf:",
  315. fn: function (aClass){
  316. var self=this;
  317. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  318. return self;}
  319. }),
  320. smalltalk.Object);
  321. smalltalk.addMethod(
  322. "_isMetaclass",
  323. smalltalk.method({
  324. selector: "isMetaclass",
  325. fn: function (){
  326. var self=this;
  327. return false;
  328. return self;}
  329. }),
  330. smalltalk.Object);
  331. smalltalk.addMethod(
  332. "_isNil",
  333. smalltalk.method({
  334. selector: "isNil",
  335. fn: function (){
  336. var self=this;
  337. return false;
  338. return self;}
  339. }),
  340. smalltalk.Object);
  341. smalltalk.addMethod(
  342. "_isNumber",
  343. smalltalk.method({
  344. selector: "isNumber",
  345. fn: function (){
  346. var self=this;
  347. return false;
  348. return self;}
  349. }),
  350. smalltalk.Object);
  351. smalltalk.addMethod(
  352. "_isParseFailure",
  353. smalltalk.method({
  354. selector: "isParseFailure",
  355. fn: function (){
  356. var self=this;
  357. return false;
  358. return self;}
  359. }),
  360. smalltalk.Object);
  361. smalltalk.addMethod(
  362. "_isString",
  363. smalltalk.method({
  364. selector: "isString",
  365. fn: function (){
  366. var self=this;
  367. return false;
  368. return self;}
  369. }),
  370. smalltalk.Object);
  371. smalltalk.addMethod(
  372. "_isSymbol",
  373. smalltalk.method({
  374. selector: "isSymbol",
  375. fn: function (){
  376. var self=this;
  377. return false;
  378. return self;}
  379. }),
  380. smalltalk.Object);
  381. smalltalk.addMethod(
  382. "_log_block_",
  383. smalltalk.method({
  384. selector: "log:block:",
  385. fn: function (aString, aBlock){
  386. var self=this;
  387. var result=nil;
  388. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(smalltalk.send(aString, "__comma", [" time: "]), "__comma", [smalltalk.send(smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return (result=smalltalk.send(aBlock, "_value", []));})]), "_printString", [])])]);
  389. return result;
  390. return self;}
  391. }),
  392. smalltalk.Object);
  393. smalltalk.addMethod(
  394. "_notNil",
  395. smalltalk.method({
  396. selector: "notNil",
  397. fn: function (){
  398. var self=this;
  399. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  400. return self;}
  401. }),
  402. smalltalk.Object);
  403. smalltalk.addMethod(
  404. "_perform_",
  405. smalltalk.method({
  406. selector: "perform:",
  407. fn: function (aSymbol){
  408. var self=this;
  409. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  410. return self;}
  411. }),
  412. smalltalk.Object);
  413. smalltalk.addMethod(
  414. "_perform_withArguments_",
  415. smalltalk.method({
  416. selector: "perform:withArguments:",
  417. fn: function (aSymbol, aCollection){
  418. var self=this;
  419. var selector=nil;
  420. (selector=smalltalk.send(aSymbol, "_asSelector", []));
  421. return smalltalk.send(self, selector, aCollection);
  422. return self;}
  423. }),
  424. smalltalk.Object);
  425. smalltalk.addMethod(
  426. "_postCopy",
  427. smalltalk.method({
  428. selector: "postCopy",
  429. fn: function (){
  430. var self=this;
  431. return self;}
  432. }),
  433. smalltalk.Object);
  434. smalltalk.addMethod(
  435. "_printNl",
  436. smalltalk.method({
  437. selector: "printNl",
  438. fn: function (){
  439. var self=this;
  440. console.log(self);
  441. return self;}
  442. }),
  443. smalltalk.Object);
  444. smalltalk.addMethod(
  445. "_printString",
  446. smalltalk.method({
  447. selector: "printString",
  448. fn: function (){
  449. var self=this;
  450. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  451. return self;}
  452. }),
  453. smalltalk.Object);
  454. smalltalk.addMethod(
  455. "_respondsTo_",
  456. smalltalk.method({
  457. selector: "respondsTo:",
  458. fn: function (aSelector){
  459. var self=this;
  460. return smalltalk.send(smalltalk.send(self, "_class", []), "_canUnderstand_", [aSelector]);
  461. return self;}
  462. }),
  463. smalltalk.Object);
  464. smalltalk.addMethod(
  465. "_shallowCopy",
  466. smalltalk.method({
  467. selector: "shallowCopy",
  468. fn: function (){
  469. var self=this;
  470. var copy = self.klass._new();
  471. for(var i in self) {
  472. if(/^@.+/.test(i)) {
  473. copy[i] = self[i];
  474. }
  475. }
  476. return copy;
  477. ;
  478. return self;}
  479. }),
  480. smalltalk.Object);
  481. smalltalk.addMethod(
  482. "_shouldNotImplement",
  483. smalltalk.method({
  484. selector: "shouldNotImplement",
  485. fn: function (){
  486. var self=this;
  487. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  488. return self;}
  489. }),
  490. smalltalk.Object);
  491. smalltalk.addMethod(
  492. "_size",
  493. smalltalk.method({
  494. selector: "size",
  495. fn: function (){
  496. var self=this;
  497. smalltalk.send(self, "_error_", ["Object not indexable"]);
  498. return self;}
  499. }),
  500. smalltalk.Object);
  501. smalltalk.addMethod(
  502. "_storeOn_",
  503. smalltalk.method({
  504. selector: "storeOn:",
  505. fn: function (aStream){
  506. var self=this;
  507. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(self, "_printString", [])]);
  508. return self;}
  509. }),
  510. smalltalk.Object);
  511. smalltalk.addMethod(
  512. "_storeString",
  513. smalltalk.method({
  514. selector: "storeString",
  515. fn: function (){
  516. var self=this;
  517. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(s){return smalltalk.send(self, "_storeOn_", [s]);})]);
  518. return self;}
  519. }),
  520. smalltalk.Object);
  521. smalltalk.addMethod(
  522. "_subclassResponsibility",
  523. smalltalk.method({
  524. selector: "subclassResponsibility",
  525. fn: function (){
  526. var self=this;
  527. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  528. return self;}
  529. }),
  530. smalltalk.Object);
  531. smalltalk.addMethod(
  532. "_try_catch_",
  533. smalltalk.method({
  534. selector: "try:catch:",
  535. fn: function (aBlock, anotherBlock){
  536. var self=this;
  537. try{result = aBlock()} catch(e) {result = anotherBlock(e)};
  538. return result;;
  539. return self;}
  540. }),
  541. smalltalk.Object);
  542. smalltalk.addMethod(
  543. "_yourself",
  544. smalltalk.method({
  545. selector: "yourself",
  546. fn: function (){
  547. var self=this;
  548. return self;
  549. return self;}
  550. }),
  551. smalltalk.Object);
  552. smalltalk.addMethod(
  553. "_~_eq",
  554. smalltalk.method({
  555. selector: "~=",
  556. fn: function (anObject){
  557. var self=this;
  558. return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq", [false]);
  559. return self;}
  560. }),
  561. smalltalk.Object);
  562. smalltalk.addMethod(
  563. "_~~",
  564. smalltalk.method({
  565. selector: "~~",
  566. fn: function (anObject){
  567. var self=this;
  568. return smalltalk.send(smalltalk.send(self, "__eq_eq", [anObject]), "__eq", [false]);
  569. return self;}
  570. }),
  571. smalltalk.Object);
  572. smalltalk.addMethod(
  573. "_initialize",
  574. smalltalk.method({
  575. selector: "initialize",
  576. fn: function (){
  577. var self=this;
  578. return self;}
  579. }),
  580. smalltalk.Object.klass);
  581. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel-Objects');
  582. smalltalk.addMethod(
  583. "_&",
  584. smalltalk.method({
  585. selector: "&",
  586. fn: function (aBoolean){
  587. var self=this;
  588. if(self == true) {
  589. return aBoolean;
  590. } else {
  591. return false;
  592. }
  593. ;
  594. return self;}
  595. }),
  596. smalltalk.Boolean);
  597. smalltalk.addMethod(
  598. "__eq",
  599. smalltalk.method({
  600. selector: "=",
  601. fn: function (aBoolean){
  602. var self=this;
  603. var $early={};
  604. try{((($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=[false]})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=[false]})();})]));
  605. return Boolean(self == true) == aBoolean;
  606. return self;
  607. } catch(e) {if(e===$early)return e[0]; throw e}}
  608. }),
  609. smalltalk.Boolean);
  610. smalltalk.addMethod(
  611. "_and_",
  612. smalltalk.method({
  613. selector: "and:",
  614. fn: function (aBlock){
  615. var self=this;
  616. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  617. return self;}
  618. }),
  619. smalltalk.Boolean);
  620. smalltalk.addMethod(
  621. "_asJSON",
  622. smalltalk.method({
  623. selector: "asJSON",
  624. fn: function (){
  625. var self=this;
  626. return self;
  627. return self;}
  628. }),
  629. smalltalk.Boolean);
  630. smalltalk.addMethod(
  631. "_deepCopy",
  632. smalltalk.method({
  633. selector: "deepCopy",
  634. fn: function (){
  635. var self=this;
  636. return self;
  637. return self;}
  638. }),
  639. smalltalk.Boolean);
  640. smalltalk.addMethod(
  641. "_ifFalse_",
  642. smalltalk.method({
  643. selector: "ifFalse:",
  644. fn: function (aBlock){
  645. var self=this;
  646. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  647. return self;}
  648. }),
  649. smalltalk.Boolean);
  650. smalltalk.addMethod(
  651. "_ifFalse_ifTrue_",
  652. smalltalk.method({
  653. selector: "ifFalse:ifTrue:",
  654. fn: function (aBlock, anotherBlock){
  655. var self=this;
  656. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  657. return self;}
  658. }),
  659. smalltalk.Boolean);
  660. smalltalk.addMethod(
  661. "_ifTrue_",
  662. smalltalk.method({
  663. selector: "ifTrue:",
  664. fn: function (aBlock){
  665. var self=this;
  666. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  667. return self;}
  668. }),
  669. smalltalk.Boolean);
  670. smalltalk.addMethod(
  671. "_ifTrue_ifFalse_",
  672. smalltalk.method({
  673. selector: "ifTrue:ifFalse:",
  674. fn: function (aBlock, anotherBlock){
  675. var self=this;
  676. if(self == true) {
  677. return aBlock();
  678. } else {
  679. return anotherBlock();
  680. }
  681. ;
  682. return self;}
  683. }),
  684. smalltalk.Boolean);
  685. smalltalk.addMethod(
  686. "_not",
  687. smalltalk.method({
  688. selector: "not",
  689. fn: function (){
  690. var self=this;
  691. return smalltalk.send(self, "__eq", [false]);
  692. return self;}
  693. }),
  694. smalltalk.Boolean);
  695. smalltalk.addMethod(
  696. "_or_",
  697. smalltalk.method({
  698. selector: "or:",
  699. fn: function (aBlock){
  700. var self=this;
  701. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  702. return self;}
  703. }),
  704. smalltalk.Boolean);
  705. smalltalk.addMethod(
  706. "_printString",
  707. smalltalk.method({
  708. selector: "printString",
  709. fn: function (){
  710. var self=this;
  711. return self.toString();
  712. return self;}
  713. }),
  714. smalltalk.Boolean);
  715. smalltalk.addMethod(
  716. "_shallowCopy",
  717. smalltalk.method({
  718. selector: "shallowCopy",
  719. fn: function (){
  720. var self=this;
  721. return self;
  722. return self;}
  723. }),
  724. smalltalk.Boolean);
  725. smalltalk.addMethod(
  726. "_|",
  727. smalltalk.method({
  728. selector: "|",
  729. fn: function (aBoolean){
  730. var self=this;
  731. if(self == true) {
  732. return true;
  733. } else {
  734. return aBoolean;
  735. }
  736. ;
  737. return self;}
  738. }),
  739. smalltalk.Boolean);
  740. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel-Objects');
  741. smalltalk.addMethod(
  742. "__plus",
  743. smalltalk.method({
  744. selector: "+",
  745. fn: function (aDate){
  746. var self=this;
  747. return self + aDate;
  748. return self;}
  749. }),
  750. smalltalk.Date);
  751. smalltalk.addMethod(
  752. "__minus",
  753. smalltalk.method({
  754. selector: "-",
  755. fn: function (aDate){
  756. var self=this;
  757. return self - aDate;
  758. return self;}
  759. }),
  760. smalltalk.Date);
  761. smalltalk.addMethod(
  762. "__lt",
  763. smalltalk.method({
  764. selector: "<",
  765. fn: function (aDate){
  766. var self=this;
  767. return self < aDate;
  768. return self;}
  769. }),
  770. smalltalk.Date);
  771. smalltalk.addMethod(
  772. "__lt_eq",
  773. smalltalk.method({
  774. selector: "<=",
  775. fn: function (aDate){
  776. var self=this;
  777. return self <= aDate;
  778. return self;}
  779. }),
  780. smalltalk.Date);
  781. smalltalk.addMethod(
  782. "__gt",
  783. smalltalk.method({
  784. selector: ">",
  785. fn: function (aDate){
  786. var self=this;
  787. return self > aDate;
  788. return self;}
  789. }),
  790. smalltalk.Date);
  791. smalltalk.addMethod(
  792. "__gt_eq",
  793. smalltalk.method({
  794. selector: ">=",
  795. fn: function (aDate){
  796. var self=this;
  797. return self >= aDate;
  798. return self;}
  799. }),
  800. smalltalk.Date);
  801. smalltalk.addMethod(
  802. "_asDateString",
  803. smalltalk.method({
  804. selector: "asDateString",
  805. fn: function (){
  806. var self=this;
  807. return self.toDateString();
  808. return self;}
  809. }),
  810. smalltalk.Date);
  811. smalltalk.addMethod(
  812. "_asLocaleString",
  813. smalltalk.method({
  814. selector: "asLocaleString",
  815. fn: function (){
  816. var self=this;
  817. return self.toLocaleString();
  818. return self;}
  819. }),
  820. smalltalk.Date);
  821. smalltalk.addMethod(
  822. "_asMilliseconds",
  823. smalltalk.method({
  824. selector: "asMilliseconds",
  825. fn: function (){
  826. var self=this;
  827. return smalltalk.send(self, "_time", []);
  828. return self;}
  829. }),
  830. smalltalk.Date);
  831. smalltalk.addMethod(
  832. "_asNumber",
  833. smalltalk.method({
  834. selector: "asNumber",
  835. fn: function (){
  836. var self=this;
  837. return smalltalk.send(self, "_asMilliseconds", []);
  838. return self;}
  839. }),
  840. smalltalk.Date);
  841. smalltalk.addMethod(
  842. "_asString",
  843. smalltalk.method({
  844. selector: "asString",
  845. fn: function (){
  846. var self=this;
  847. return self.toString();
  848. return self;}
  849. }),
  850. smalltalk.Date);
  851. smalltalk.addMethod(
  852. "_asTimeString",
  853. smalltalk.method({
  854. selector: "asTimeString",
  855. fn: function (){
  856. var self=this;
  857. return self.toTimeString();
  858. return self;}
  859. }),
  860. smalltalk.Date);
  861. smalltalk.addMethod(
  862. "_day",
  863. smalltalk.method({
  864. selector: "day",
  865. fn: function (){
  866. var self=this;
  867. return smalltalk.send(self, "_dayOfWeek", []);
  868. return self;}
  869. }),
  870. smalltalk.Date);
  871. smalltalk.addMethod(
  872. "_day_",
  873. smalltalk.method({
  874. selector: "day:",
  875. fn: function (aNumber){
  876. var self=this;
  877. smalltalk.send(self, "_dayOfWeek_", [aNumber]);
  878. return self;}
  879. }),
  880. smalltalk.Date);
  881. smalltalk.addMethod(
  882. "_dayOfMonth",
  883. smalltalk.method({
  884. selector: "dayOfMonth",
  885. fn: function (){
  886. var self=this;
  887. return self.getDate();
  888. return self;}
  889. }),
  890. smalltalk.Date);
  891. smalltalk.addMethod(
  892. "_dayOfMonth_",
  893. smalltalk.method({
  894. selector: "dayOfMonth:",
  895. fn: function (aNumber){
  896. var self=this;
  897. self.setDate(aNumber);
  898. return self;}
  899. }),
  900. smalltalk.Date);
  901. smalltalk.addMethod(
  902. "_dayOfWeek",
  903. smalltalk.method({
  904. selector: "dayOfWeek",
  905. fn: function (){
  906. var self=this;
  907. return self.getDay() + 1;
  908. return self;}
  909. }),
  910. smalltalk.Date);
  911. smalltalk.addMethod(
  912. "_dayOfWeek_",
  913. smalltalk.method({
  914. selector: "dayOfWeek:",
  915. fn: function (aNumber){
  916. var self=this;
  917. return self.setDay(aNumber - 1);
  918. return self;}
  919. }),
  920. smalltalk.Date);
  921. smalltalk.addMethod(
  922. "_hours",
  923. smalltalk.method({
  924. selector: "hours",
  925. fn: function (){
  926. var self=this;
  927. return self.getHours();
  928. return self;}
  929. }),
  930. smalltalk.Date);
  931. smalltalk.addMethod(
  932. "_hours_",
  933. smalltalk.method({
  934. selector: "hours:",
  935. fn: function (aNumber){
  936. var self=this;
  937. self.setHours(aNumber);
  938. return self;}
  939. }),
  940. smalltalk.Date);
  941. smalltalk.addMethod(
  942. "_milliseconds",
  943. smalltalk.method({
  944. selector: "milliseconds",
  945. fn: function (){
  946. var self=this;
  947. return self.getMilliseconds();
  948. return self;}
  949. }),
  950. smalltalk.Date);
  951. smalltalk.addMethod(
  952. "_milliseconds_",
  953. smalltalk.method({
  954. selector: "milliseconds:",
  955. fn: function (aNumber){
  956. var self=this;
  957. self.setMilliseconds(aNumber);
  958. return self;}
  959. }),
  960. smalltalk.Date);
  961. smalltalk.addMethod(
  962. "_minutes",
  963. smalltalk.method({
  964. selector: "minutes",
  965. fn: function (){
  966. var self=this;
  967. return self.getMinutes();
  968. return self;}
  969. }),
  970. smalltalk.Date);
  971. smalltalk.addMethod(
  972. "_minutes_",
  973. smalltalk.method({
  974. selector: "minutes:",
  975. fn: function (aNumber){
  976. var self=this;
  977. self.setMinutes(aNumber);
  978. return self;}
  979. }),
  980. smalltalk.Date);
  981. smalltalk.addMethod(
  982. "_month",
  983. smalltalk.method({
  984. selector: "month",
  985. fn: function (){
  986. var self=this;
  987. return self.getMonth() + 1;
  988. return self;}
  989. }),
  990. smalltalk.Date);
  991. smalltalk.addMethod(
  992. "_month_",
  993. smalltalk.method({
  994. selector: "month:",
  995. fn: function (aNumber){
  996. var self=this;
  997. self.setMonth(aNumber - 1);
  998. return self;}
  999. }),
  1000. smalltalk.Date);
  1001. smalltalk.addMethod(
  1002. "_printString",
  1003. smalltalk.method({
  1004. selector: "printString",
  1005. fn: function (){
  1006. var self=this;
  1007. return smalltalk.send(self, "_asString", []);
  1008. return self;}
  1009. }),
  1010. smalltalk.Date);
  1011. smalltalk.addMethod(
  1012. "_seconds",
  1013. smalltalk.method({
  1014. selector: "seconds",
  1015. fn: function (){
  1016. var self=this;
  1017. return self.getSeconds();
  1018. return self;}
  1019. }),
  1020. smalltalk.Date);
  1021. smalltalk.addMethod(
  1022. "_seconds_",
  1023. smalltalk.method({
  1024. selector: "seconds:",
  1025. fn: function (aNumber){
  1026. var self=this;
  1027. self.setSeconds(aNumber);
  1028. return self;}
  1029. }),
  1030. smalltalk.Date);
  1031. smalltalk.addMethod(
  1032. "_time",
  1033. smalltalk.method({
  1034. selector: "time",
  1035. fn: function (){
  1036. var self=this;
  1037. return self.getTime();
  1038. return self;}
  1039. }),
  1040. smalltalk.Date);
  1041. smalltalk.addMethod(
  1042. "_time_",
  1043. smalltalk.method({
  1044. selector: "time:",
  1045. fn: function (aNumber){
  1046. var self=this;
  1047. self.setTime(aNumber);
  1048. return self;}
  1049. }),
  1050. smalltalk.Date);
  1051. smalltalk.addMethod(
  1052. "_year",
  1053. smalltalk.method({
  1054. selector: "year",
  1055. fn: function (){
  1056. var self=this;
  1057. return self.getFullYear();
  1058. return self;}
  1059. }),
  1060. smalltalk.Date);
  1061. smalltalk.addMethod(
  1062. "_year_",
  1063. smalltalk.method({
  1064. selector: "year:",
  1065. fn: function (aNumber){
  1066. var self=this;
  1067. self.setFullYear(aNumber);
  1068. return self;}
  1069. }),
  1070. smalltalk.Date);
  1071. smalltalk.addMethod(
  1072. "_fromMilliseconds_",
  1073. smalltalk.method({
  1074. selector: "fromMilliseconds:",
  1075. fn: function (aNumber){
  1076. var self=this;
  1077. return smalltalk.send(self, "_new_", [aNumber]);
  1078. return self;}
  1079. }),
  1080. smalltalk.Date.klass);
  1081. smalltalk.addMethod(
  1082. "_fromSeconds_",
  1083. smalltalk.method({
  1084. selector: "fromSeconds:",
  1085. fn: function (aNumber){
  1086. var self=this;
  1087. return smalltalk.send(self, "_fromMilliseconds_", [((($receiver = aNumber).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))]);
  1088. return self;}
  1089. }),
  1090. smalltalk.Date.klass);
  1091. smalltalk.addMethod(
  1092. "_fromString_",
  1093. smalltalk.method({
  1094. selector: "fromString:",
  1095. fn: function (aString){
  1096. var self=this;
  1097. return smalltalk.send(self, "_new_", [aString]);
  1098. return self;}
  1099. }),
  1100. smalltalk.Date.klass);
  1101. smalltalk.addMethod(
  1102. "_millisecondsToRun_",
  1103. smalltalk.method({
  1104. selector: "millisecondsToRun:",
  1105. fn: function (aBlock){
  1106. var self=this;
  1107. var t=nil;
  1108. (t=smalltalk.send((smalltalk.Date || Date), "_now", []));
  1109. smalltalk.send(aBlock, "_value", []);
  1110. return ((($receiver = smalltalk.send((smalltalk.Date || Date), "_now", [])).klass === smalltalk.Number) ? $receiver -t : smalltalk.send($receiver, "__minus", [t]));
  1111. return self;}
  1112. }),
  1113. smalltalk.Date.klass);
  1114. smalltalk.addMethod(
  1115. "_new_",
  1116. smalltalk.method({
  1117. selector: "new:",
  1118. fn: function (anObject){
  1119. var self=this;
  1120. return new Date(anObject);
  1121. return self;}
  1122. }),
  1123. smalltalk.Date.klass);
  1124. smalltalk.addMethod(
  1125. "_now",
  1126. smalltalk.method({
  1127. selector: "now",
  1128. fn: function (){
  1129. var self=this;
  1130. return smalltalk.send(self, "_today", []);
  1131. return self;}
  1132. }),
  1133. smalltalk.Date.klass);
  1134. smalltalk.addMethod(
  1135. "_today",
  1136. smalltalk.method({
  1137. selector: "today",
  1138. fn: function (){
  1139. var self=this;
  1140. return smalltalk.send(self, "_new", []);
  1141. return self;}
  1142. }),
  1143. smalltalk.Date.klass);
  1144. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
  1145. smalltalk.addMethod(
  1146. "_at_",
  1147. smalltalk.method({
  1148. selector: "at:",
  1149. fn: function (aSymbol){
  1150. var self=this;
  1151. var attr=nil;
  1152. (attr=smalltalk.send(aSymbol, "_asString", []));
  1153. return self['@jsObject'][attr];
  1154. return self;}
  1155. }),
  1156. smalltalk.JSObjectProxy);
  1157. smalltalk.addMethod(
  1158. "_at_put_",
  1159. smalltalk.method({
  1160. selector: "at:put:",
  1161. fn: function (aSymbol, anObject){
  1162. var self=this;
  1163. var attr=nil;
  1164. (attr=smalltalk.send(aSymbol, "_asString", []));
  1165. self['@jsObject'][attr] = anObject;
  1166. return self;}
  1167. }),
  1168. smalltalk.JSObjectProxy);
  1169. smalltalk.addMethod(
  1170. "_doesNotUnderstand_",
  1171. smalltalk.method({
  1172. selector: "doesNotUnderstand:",
  1173. fn: function (aMessage){
  1174. var self=this;
  1175. var obj=nil;
  1176. var selector=nil;
  1177. var jsSelector=nil;
  1178. var arguments=nil;
  1179. (obj=smalltalk.send(self, "_jsObject", []));
  1180. (selector=smalltalk.send(aMessage, "_selector", []));
  1181. (jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []));
  1182. (arguments=smalltalk.send(aMessage, "_arguments", []));
  1183. if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
  1184. smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.JSObjectProxy.superclass || nil);
  1185. return self;}
  1186. }),
  1187. smalltalk.JSObjectProxy);
  1188. smalltalk.addMethod(
  1189. "_inspectOn_",
  1190. smalltalk.method({
  1191. selector: "inspectOn:",
  1192. fn: function (anInspector){
  1193. var self=this;
  1194. var variables=nil;
  1195. (variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  1196. smalltalk.send(variables, "_at_put_", ["#self", smalltalk.send(self, "_jsObject", [])]);
  1197. smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
  1198. for(var i in self['@jsObject']) {
  1199. variables._at_put_(i, self['@jsObject'][i]);
  1200. };
  1201. smalltalk.send(anInspector, "_setVariables_", [variables]);
  1202. return self;}
  1203. }),
  1204. smalltalk.JSObjectProxy);
  1205. smalltalk.addMethod(
  1206. "_jsObject",
  1207. smalltalk.method({
  1208. selector: "jsObject",
  1209. fn: function (){
  1210. var self=this;
  1211. return self['@jsObject'];
  1212. return self;}
  1213. }),
  1214. smalltalk.JSObjectProxy);
  1215. smalltalk.addMethod(
  1216. "_jsObject_",
  1217. smalltalk.method({
  1218. selector: "jsObject:",
  1219. fn: function (aJSObject){
  1220. var self=this;
  1221. (self['@jsObject']=aJSObject);
  1222. return self;}
  1223. }),
  1224. smalltalk.JSObjectProxy);
  1225. smalltalk.addMethod(
  1226. "_printString",
  1227. smalltalk.method({
  1228. selector: "printString",
  1229. fn: function (){
  1230. var self=this;
  1231. return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  1232. return self;}
  1233. }),
  1234. smalltalk.JSObjectProxy);
  1235. smalltalk.addMethod(
  1236. "_on_",
  1237. smalltalk.method({
  1238. selector: "on:",
  1239. fn: function (aJSObject){
  1240. var self=this;
  1241. return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  1242. return self;}
  1243. }),
  1244. smalltalk.JSObjectProxy.klass);
  1245. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel-Objects');
  1246. smalltalk.addMethod(
  1247. "_&",
  1248. smalltalk.method({
  1249. selector: "&",
  1250. fn: function (aNumber){
  1251. var self=this;
  1252. return self & aNumber;
  1253. return self;}
  1254. }),
  1255. smalltalk.Number);
  1256. smalltalk.addMethod(
  1257. "__star",
  1258. smalltalk.method({
  1259. selector: "*",
  1260. fn: function (aNumber){
  1261. var self=this;
  1262. return self * aNumber;
  1263. return self;}
  1264. }),
  1265. smalltalk.Number);
  1266. smalltalk.addMethod(
  1267. "__plus",
  1268. smalltalk.method({
  1269. selector: "+",
  1270. fn: function (aNumber){
  1271. var self=this;
  1272. return self + aNumber;
  1273. return self;}
  1274. }),
  1275. smalltalk.Number);
  1276. smalltalk.addMethod(
  1277. "__minus",
  1278. smalltalk.method({
  1279. selector: "-",
  1280. fn: function (aNumber){
  1281. var self=this;
  1282. return self - aNumber;
  1283. return self;}
  1284. }),
  1285. smalltalk.Number);
  1286. smalltalk.addMethod(
  1287. "__slash",
  1288. smalltalk.method({
  1289. selector: "/",
  1290. fn: function (aNumber){
  1291. var self=this;
  1292. return self / aNumber;
  1293. return self;}
  1294. }),
  1295. smalltalk.Number);
  1296. smalltalk.addMethod(
  1297. "__lt",
  1298. smalltalk.method({
  1299. selector: "<",
  1300. fn: function (aNumber){
  1301. var self=this;
  1302. return self < aNumber;
  1303. return self;}
  1304. }),
  1305. smalltalk.Number);
  1306. smalltalk.addMethod(
  1307. "__lt_eq",
  1308. smalltalk.method({
  1309. selector: "<=",
  1310. fn: function (aNumber){
  1311. var self=this;
  1312. return self <= aNumber;
  1313. return self;}
  1314. }),
  1315. smalltalk.Number);
  1316. smalltalk.addMethod(
  1317. "__eq",
  1318. smalltalk.method({
  1319. selector: "=",
  1320. fn: function (aNumber){
  1321. var self=this;
  1322. var $early={};
  1323. try{((($receiver = smalltalk.send(aNumber, "_isNumber", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=[false]})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=[false]})();})]));
  1324. return Number(self) == aNumber;
  1325. return self;
  1326. } catch(e) {if(e===$early)return e[0]; throw e}}
  1327. }),
  1328. smalltalk.Number);
  1329. smalltalk.addMethod(
  1330. "__gt",
  1331. smalltalk.method({
  1332. selector: ">",
  1333. fn: function (aNumber){
  1334. var self=this;
  1335. return self > aNumber;
  1336. return self;}
  1337. }),
  1338. smalltalk.Number);
  1339. smalltalk.addMethod(
  1340. "__gt_eq",
  1341. smalltalk.method({
  1342. selector: ">=",
  1343. fn: function (aNumber){
  1344. var self=this;
  1345. return self >= aNumber;
  1346. return self;}
  1347. }),
  1348. smalltalk.Number);
  1349. smalltalk.addMethod(
  1350. "__at",
  1351. smalltalk.method({
  1352. selector: "@",
  1353. fn: function (aNumber){
  1354. var self=this;
  1355. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, aNumber]);
  1356. return self;}
  1357. }),
  1358. smalltalk.Number);
  1359. smalltalk.addMethod(
  1360. "_\x5c\x5c",
  1361. smalltalk.method({
  1362. selector: "\x5c\x5c",
  1363. fn: function (aNumber){
  1364. var self=this;
  1365. return self % aNumber;
  1366. return self;}
  1367. }),
  1368. smalltalk.Number);
  1369. smalltalk.addMethod(
  1370. "_asJSON",
  1371. smalltalk.method({
  1372. selector: "asJSON",
  1373. fn: function (){
  1374. var self=this;
  1375. return self;
  1376. return self;}
  1377. }),
  1378. smalltalk.Number);
  1379. smalltalk.addMethod(
  1380. "_asJavascript",
  1381. smalltalk.method({
  1382. selector: "asJavascript",
  1383. fn: function (){
  1384. var self=this;
  1385. return smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [")"]);
  1386. return self;}
  1387. }),
  1388. smalltalk.Number);
  1389. smalltalk.addMethod(
  1390. "_asPoint",
  1391. smalltalk.method({
  1392. selector: "asPoint",
  1393. fn: function (){
  1394. var self=this;
  1395. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, self]);
  1396. return self;}
  1397. }),
  1398. smalltalk.Number);
  1399. smalltalk.addMethod(
  1400. "_asString",
  1401. smalltalk.method({
  1402. selector: "asString",
  1403. fn: function (){
  1404. var self=this;
  1405. return smalltalk.send(self, "_printString", []);
  1406. return self;}
  1407. }),
  1408. smalltalk.Number);
  1409. smalltalk.addMethod(
  1410. "_atRandom",
  1411. smalltalk.method({
  1412. selector: "atRandom",
  1413. fn: function (){
  1414. var self=this;
  1415. return ((($receiver = smalltalk.send(((($receiver = smalltalk.send(smalltalk.send((smalltalk.Random || Random), "_new", []), "_next", [])).klass === smalltalk.Number) ? $receiver *self : smalltalk.send($receiver, "__star", [self])), "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
  1416. return self;}
  1417. }),
  1418. smalltalk.Number);
  1419. smalltalk.addMethod(
  1420. "_clearInterval",
  1421. smalltalk.method({
  1422. selector: "clearInterval",
  1423. fn: function (){
  1424. var self=this;
  1425. clearInterval(Number(self));
  1426. return self;}
  1427. }),
  1428. smalltalk.Number);
  1429. smalltalk.addMethod(
  1430. "_clearTimeout",
  1431. smalltalk.method({
  1432. selector: "clearTimeout",
  1433. fn: function (){
  1434. var self=this;
  1435. clearTimeout(Number(self));
  1436. return self;}
  1437. }),
  1438. smalltalk.Number);
  1439. smalltalk.addMethod(
  1440. "_copy",
  1441. smalltalk.method({
  1442. selector: "copy",
  1443. fn: function (){
  1444. var self=this;
  1445. return self;
  1446. return self;}
  1447. }),
  1448. smalltalk.Number);
  1449. smalltalk.addMethod(
  1450. "_deepCopy",
  1451. smalltalk.method({
  1452. selector: "deepCopy",
  1453. fn: function (){
  1454. var self=this;
  1455. return smalltalk.send(self, "_copy", []);
  1456. return self;}
  1457. }),
  1458. smalltalk.Number);
  1459. smalltalk.addMethod(
  1460. "_even",
  1461. smalltalk.method({
  1462. selector: "even",
  1463. fn: function (){
  1464. var self=this;
  1465. return smalltalk.send((0), "__eq", [smalltalk.send(self, "_\\\\", [(2)])]);
  1466. return self;}
  1467. }),
  1468. smalltalk.Number);
  1469. smalltalk.addMethod(
  1470. "_identityHash",
  1471. smalltalk.method({
  1472. selector: "identityHash",
  1473. fn: function (){
  1474. var self=this;
  1475. return smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", ["n"]);
  1476. return self;}
  1477. }),
  1478. smalltalk.Number);
  1479. smalltalk.addMethod(
  1480. "_isNumber",
  1481. smalltalk.method({
  1482. selector: "isNumber",
  1483. fn: function (){
  1484. var self=this;
  1485. return true;
  1486. return self;}
  1487. }),
  1488. smalltalk.Number);
  1489. smalltalk.addMethod(
  1490. "_isZero",
  1491. smalltalk.method({
  1492. selector: "isZero",
  1493. fn: function (){
  1494. var self=this;
  1495. return smalltalk.send(self, "__eq", [(0)]);
  1496. return self;}
  1497. }),
  1498. smalltalk.Number);
  1499. smalltalk.addMethod(
  1500. "_max_",
  1501. smalltalk.method({
  1502. selector: "max:",
  1503. fn: function (aNumber){
  1504. var self=this;
  1505. return Math.max(self, aNumber);;
  1506. return self;}
  1507. }),
  1508. smalltalk.Number);
  1509. smalltalk.addMethod(
  1510. "_min_",
  1511. smalltalk.method({
  1512. selector: "min:",
  1513. fn: function (aNumber){
  1514. var self=this;
  1515. return Math.min(self, aNumber);;
  1516. return self;}
  1517. }),
  1518. smalltalk.Number);
  1519. smalltalk.addMethod(
  1520. "_negated",
  1521. smalltalk.method({
  1522. selector: "negated",
  1523. fn: function (){
  1524. var self=this;
  1525. return (0) - self;
  1526. return self;}
  1527. }),
  1528. smalltalk.Number);
  1529. smalltalk.addMethod(
  1530. "_negative",
  1531. smalltalk.method({
  1532. selector: "negative",
  1533. fn: function (){
  1534. var self=this;
  1535. return self < (0);
  1536. return self;}
  1537. }),
  1538. smalltalk.Number);
  1539. smalltalk.addMethod(
  1540. "_odd",
  1541. smalltalk.method({
  1542. selector: "odd",
  1543. fn: function (){
  1544. var self=this;
  1545. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1546. return self;}
  1547. }),
  1548. smalltalk.Number);
  1549. smalltalk.addMethod(
  1550. "_positive",
  1551. smalltalk.method({
  1552. selector: "positive",
  1553. fn: function (){
  1554. var self=this;
  1555. return self >= (0);
  1556. return self;}
  1557. }),
  1558. smalltalk.Number);
  1559. smalltalk.addMethod(
  1560. "_printShowingDecimalPlaces_",
  1561. smalltalk.method({
  1562. selector: "printShowingDecimalPlaces:",
  1563. fn: function (placesDesired){
  1564. var self=this;
  1565. return self.toFixed(placesDesired);
  1566. return self;}
  1567. }),
  1568. smalltalk.Number);
  1569. smalltalk.addMethod(
  1570. "_printString",
  1571. smalltalk.method({
  1572. selector: "printString",
  1573. fn: function (){
  1574. var self=this;
  1575. return String(self);
  1576. return self;}
  1577. }),
  1578. smalltalk.Number);
  1579. smalltalk.addMethod(
  1580. "_rounded",
  1581. smalltalk.method({
  1582. selector: "rounded",
  1583. fn: function (){
  1584. var self=this;
  1585. return Math.round(self);;
  1586. return self;}
  1587. }),
  1588. smalltalk.Number);
  1589. smalltalk.addMethod(
  1590. "_sqrt",
  1591. smalltalk.method({
  1592. selector: "sqrt",
  1593. fn: function (){
  1594. var self=this;
  1595. return Math.sqrt(self);
  1596. return self;}
  1597. }),
  1598. smalltalk.Number);
  1599. smalltalk.addMethod(
  1600. "_squared",
  1601. smalltalk.method({
  1602. selector: "squared",
  1603. fn: function (){
  1604. var self=this;
  1605. return self * self;
  1606. return self;}
  1607. }),
  1608. smalltalk.Number);
  1609. smalltalk.addMethod(
  1610. "_timesRepeat_",
  1611. smalltalk.method({
  1612. selector: "timesRepeat:",
  1613. fn: function (aBlock){
  1614. var self=this;
  1615. var integer=nil;
  1616. var count=nil;
  1617. (integer=smalltalk.send(self, "_truncated", []));
  1618. (count=(1));
  1619. (function(){while(!(function(){return ((($receiver = count).klass === smalltalk.Number) ? $receiver >self : smalltalk.send($receiver, "__gt", [self]));})()) {(function(){smalltalk.send(aBlock, "_value", []);return (count=((($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})()}})();
  1620. return self;}
  1621. }),
  1622. smalltalk.Number);
  1623. smalltalk.addMethod(
  1624. "_to_",
  1625. smalltalk.method({
  1626. selector: "to:",
  1627. fn: function (aNumber){
  1628. var self=this;
  1629. var array=nil;
  1630. var first=nil;
  1631. var last=nil;
  1632. var count=nil;
  1633. (first=smalltalk.send(self, "_truncated", []));
  1634. (last=((($receiver = smalltalk.send(aNumber, "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
  1635. (count=(1));
  1636. (array=smalltalk.send((smalltalk.Array || Array), "_new", []));
  1637. smalltalk.send(((($receiver = last).klass === smalltalk.Number) ? $receiver -first : smalltalk.send($receiver, "__minus", [first])), "_timesRepeat_", [(function(){smalltalk.send(array, "_at_put_", [count, first]);(count=((($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return (first=((($receiver = first).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
  1638. return array;
  1639. return self;}
  1640. }),
  1641. smalltalk.Number);
  1642. smalltalk.addMethod(
  1643. "_to_by_",
  1644. smalltalk.method({
  1645. selector: "to:by:",
  1646. fn: function (stop, step){
  1647. var self=this;
  1648. var array=nil;
  1649. var value=nil;
  1650. var pos=nil;
  1651. (value=self);
  1652. (array=smalltalk.send((smalltalk.Array || Array), "_new", []));
  1653. (pos=(1));
  1654. ((($receiver = smalltalk.send(step, "__eq", [(0)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", ["step must be non-zero"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", ["step must be non-zero"]);})]));
  1655. ((($receiver = ((($receiver = step).klass === smalltalk.Number) ? $receiver <(0) : smalltalk.send($receiver, "__lt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);(pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return (value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step])));})()}})();})() : (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);(pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return (value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step])));})()}})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);(pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return (value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step])));})()}})();}), (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);(pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return (value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step])));})()}})();})]));
  1656. return array;
  1657. return self;}
  1658. }),
  1659. smalltalk.Number);
  1660. smalltalk.addMethod(
  1661. "_to_by_do_",
  1662. smalltalk.method({
  1663. selector: "to:by:do:",
  1664. fn: function (stop, step, aBlock){
  1665. var self=this;
  1666. var value=nil;
  1667. (value=self);
  1668. ((($receiver = smalltalk.send(step, "__eq", [(0)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", ["step must be non-zero"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", ["step must be non-zero"]);})]));
  1669. ((($receiver = ((($receiver = step).klass === smalltalk.Number) ? $receiver <(0) : smalltalk.send($receiver, "__lt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return (value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step])));})()}})();})() : (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return (value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step])));})()}})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return (value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step])));})()}})();}), (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return (value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step])));})()}})();})]));
  1670. return self;}
  1671. }),
  1672. smalltalk.Number);
  1673. smalltalk.addMethod(
  1674. "_to_do_",
  1675. smalltalk.method({
  1676. selector: "to:do:",
  1677. fn: function (stop, aBlock){
  1678. var self=this;
  1679. var nextValue=nil;
  1680. (nextValue=self);
  1681. (function(){while((function(){return ((($receiver = nextValue).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [nextValue]);return (nextValue=((($receiver = nextValue).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})()}})();
  1682. return self;}
  1683. }),
  1684. smalltalk.Number);
  1685. smalltalk.addMethod(
  1686. "_truncated",
  1687. smalltalk.method({
  1688. selector: "truncated",
  1689. fn: function (){
  1690. var self=this;
  1691. var result=nil;
  1692. ((($receiver = self >= (0)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return result = Math.floor(self);;})() : (function(){return result = (Math.floor(self * (-1)) * (-1));;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return result = Math.floor(self);;}), (function(){return result = (Math.floor(self * (-1)) * (-1));;})]));
  1693. return result;
  1694. return self;}
  1695. }),
  1696. smalltalk.Number);
  1697. smalltalk.addMethod(
  1698. "_|",
  1699. smalltalk.method({
  1700. selector: "|",
  1701. fn: function (aNumber){
  1702. var self=this;
  1703. return self | aNumber;
  1704. return self;}
  1705. }),
  1706. smalltalk.Number);
  1707. smalltalk.addMethod(
  1708. "_pi",
  1709. smalltalk.method({
  1710. selector: "pi",
  1711. fn: function (){
  1712. var self=this;
  1713. return Math.PI;
  1714. return self;}
  1715. }),
  1716. smalltalk.Number.klass);
  1717. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
  1718. smalltalk.addMethod(
  1719. "_classes",
  1720. smalltalk.method({
  1721. selector: "classes",
  1722. fn: function (){
  1723. var self=this;
  1724. return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_select_", [(function(c){return smalltalk.send(smalltalk.send(c, "_package", []), "__eq_eq", [self]);})]);
  1725. return self;}
  1726. }),
  1727. smalltalk.Package);
  1728. smalltalk.addMethod(
  1729. "_commitPathJs",
  1730. smalltalk.method({
  1731. selector: "commitPathJs",
  1732. fn: function (){
  1733. var self=this;
  1734. return (($receiver = self['@commitPathJs']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathJs", []);})() : $receiver;
  1735. return self;}
  1736. }),
  1737. smalltalk.Package);
  1738. smalltalk.addMethod(
  1739. "_commitPathJs_",
  1740. smalltalk.method({
  1741. selector: "commitPathJs:",
  1742. fn: function (aString){
  1743. var self=this;
  1744. (self['@commitPathJs']=aString);
  1745. return self;}
  1746. }),
  1747. smalltalk.Package);
  1748. smalltalk.addMethod(
  1749. "_commitPathSt",
  1750. smalltalk.method({
  1751. selector: "commitPathSt",
  1752. fn: function (){
  1753. var self=this;
  1754. return (($receiver = self['@commitPathSt']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathSt", []);})() : $receiver;
  1755. return self;}
  1756. }),
  1757. smalltalk.Package);
  1758. smalltalk.addMethod(
  1759. "_commitPathSt_",
  1760. smalltalk.method({
  1761. selector: "commitPathSt:",
  1762. fn: function (aString){
  1763. var self=this;
  1764. (self['@commitPathSt']=aString);
  1765. return self;}
  1766. }),
  1767. smalltalk.Package);
  1768. smalltalk.addMethod(
  1769. "_dependencies",
  1770. smalltalk.method({
  1771. selector: "dependencies",
  1772. fn: function (){
  1773. var self=this;
  1774. return smalltalk.send(self, "_propertyAt_ifAbsent_", ["dependencies", (function(){return [];})]);
  1775. return self;}
  1776. }),
  1777. smalltalk.Package);
  1778. smalltalk.addMethod(
  1779. "_dependencies_",
  1780. smalltalk.method({
  1781. selector: "dependencies:",
  1782. fn: function (anArray){
  1783. var self=this;
  1784. return smalltalk.send(self, "_propertyAt_put_", ["dependencies", anArray]);
  1785. return self;}
  1786. }),
  1787. smalltalk.Package);
  1788. smalltalk.addMethod(
  1789. "_jsProperties",
  1790. smalltalk.method({
  1791. selector: "jsProperties",
  1792. fn: function (){
  1793. var self=this;
  1794. return self.properties;
  1795. return self;}
  1796. }),
  1797. smalltalk.Package);
  1798. smalltalk.addMethod(
  1799. "_jsProperties_",
  1800. smalltalk.method({
  1801. selector: "jsProperties:",
  1802. fn: function (aJSObject){
  1803. var self=this;
  1804. return self.properties = aJSObject;
  1805. return self;}
  1806. }),
  1807. smalltalk.Package);
  1808. smalltalk.addMethod(
  1809. "_name",
  1810. smalltalk.method({
  1811. selector: "name",
  1812. fn: function (){
  1813. var self=this;
  1814. return self.pkgName;
  1815. return self;}
  1816. }),
  1817. smalltalk.Package);
  1818. smalltalk.addMethod(
  1819. "_name_",
  1820. smalltalk.method({
  1821. selector: "name:",
  1822. fn: function (aString){
  1823. var self=this;
  1824. self.pkgName = aString;
  1825. return self;}
  1826. }),
  1827. smalltalk.Package);
  1828. smalltalk.addMethod(
  1829. "_printString",
  1830. smalltalk.method({
  1831. selector: "printString",
  1832. fn: function (){
  1833. var self=this;
  1834. return smalltalk.send(self, "_name", []);
  1835. return self;}
  1836. }),
  1837. smalltalk.Package);
  1838. smalltalk.addMethod(
  1839. "_properties",
  1840. smalltalk.method({
  1841. selector: "properties",
  1842. fn: function (){
  1843. var self=this;
  1844. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_readJSObject_", [smalltalk.send(self, "_basicAt_", ["properties"])]);
  1845. return self;}
  1846. }),
  1847. smalltalk.Package);
  1848. smalltalk.addMethod(
  1849. "_properties_",
  1850. smalltalk.method({
  1851. selector: "properties:",
  1852. fn: function (aDict){
  1853. var self=this;
  1854. var object=nil;
  1855. object = {};;
  1856. smalltalk.send(aDict, "_keysAndValuesDo_", [(function(key, value){return object[key] = value;})]);
  1857. return self.properties = object;
  1858. return self;}
  1859. }),
  1860. smalltalk.Package);
  1861. smalltalk.addMethod(
  1862. "_propertiesAsJSON",
  1863. smalltalk.method({
  1864. selector: "propertiesAsJSON",
  1865. fn: function (){
  1866. var self=this;
  1867. return JSON.stringify(self.properties);
  1868. return self;}
  1869. }),
  1870. smalltalk.Package);
  1871. smalltalk.addMethod(
  1872. "_propertyAt_",
  1873. smalltalk.method({
  1874. selector: "propertyAt:",
  1875. fn: function (key){
  1876. var self=this;
  1877. return self.properties[key];
  1878. return self;}
  1879. }),
  1880. smalltalk.Package);
  1881. smalltalk.addMethod(
  1882. "_propertyAt_ifAbsent_",
  1883. smalltalk.method({
  1884. selector: "propertyAt:ifAbsent:",
  1885. fn: function (key, block){
  1886. var self=this;
  1887. return (($receiver = smalltalk.send(self, "_propertyAt_", [key])) == nil || $receiver == undefined) ? (function(){return smalltalk.send(block, "_value", []);})() : $receiver;
  1888. return self;}
  1889. }),
  1890. smalltalk.Package);
  1891. smalltalk.addMethod(
  1892. "_propertyAt_put_",
  1893. smalltalk.method({
  1894. selector: "propertyAt:put:",
  1895. fn: function (key, value){
  1896. var self=this;
  1897. return self.properties[key] = value;
  1898. return self;}
  1899. }),
  1900. smalltalk.Package);
  1901. smalltalk.addMethod(
  1902. "_sortedClasses",
  1903. smalltalk.method({
  1904. selector: "sortedClasses",
  1905. fn: function (){
  1906. var self=this;
  1907. return smalltalk.send(smalltalk.send(self, "_class", []), "_sortedClasses_", [smalltalk.send(self, "_classes", [])]);
  1908. return self;}
  1909. }),
  1910. smalltalk.Package);
  1911. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  1912. smalltalk.addMethod(
  1913. "_commitToLocalStorage_",
  1914. smalltalk.method({
  1915. selector: "commitToLocalStorage:",
  1916. fn: function (aPackageName){
  1917. var self=this;
  1918. var key=nil;
  1919. var sourceCode=nil;
  1920. (key=smalltalk.send("smalltalk.packages.", "__comma", [aPackageName]));
  1921. (sourceCode=smalltalk.send(smalltalk.send((smalltalk.Exporter || Exporter), "_new", []), "_exportPackage_", [aPackageName]));
  1922. localStorage[key] = escape(sourceCode);
  1923. return self;}
  1924. }),
  1925. smalltalk.Package.klass);
  1926. smalltalk.addMethod(
  1927. "_defaultCommitPathJs",
  1928. smalltalk.method({
  1929. selector: "defaultCommitPathJs",
  1930. fn: function (){
  1931. var self=this;
  1932. return (($receiver = self['@defaultCommitPathJs']) == nil || $receiver == undefined) ? (function(){return (self['@defaultCommitPathJs']="js");})() : $receiver;
  1933. return self;}
  1934. }),
  1935. smalltalk.Package.klass);
  1936. smalltalk.addMethod(
  1937. "_defaultCommitPathJs_",
  1938. smalltalk.method({
  1939. selector: "defaultCommitPathJs:",
  1940. fn: function (aString){
  1941. var self=this;
  1942. (self['@defaultCommitPathJs']=aString);
  1943. return self;}
  1944. }),
  1945. smalltalk.Package.klass);
  1946. smalltalk.addMethod(
  1947. "_defaultCommitPathSt",
  1948. smalltalk.method({
  1949. selector: "defaultCommitPathSt",
  1950. fn: function (){
  1951. var self=this;
  1952. return (($receiver = self['@defaultCommitPathSt']) == nil || $receiver == undefined) ? (function(){return (self['@defaultCommitPathSt']="st");})() : $receiver;
  1953. return self;}
  1954. }),
  1955. smalltalk.Package.klass);
  1956. smalltalk.addMethod(
  1957. "_defaultCommitPathSt_",
  1958. smalltalk.method({
  1959. selector: "defaultCommitPathSt:",
  1960. fn: function (aString){
  1961. var self=this;
  1962. (self['@defaultCommitPathSt']=aString);
  1963. return self;}
  1964. }),
  1965. smalltalk.Package.klass);
  1966. smalltalk.addMethod(
  1967. "_fetch_",
  1968. smalltalk.method({
  1969. selector: "fetch:",
  1970. fn: function (aPackageName){
  1971. var self=this;
  1972. smalltalk.send(self, "_fetch_prefix_", [aPackageName, smalltalk.send(smalltalk.send(self, "_defaultCommitPathJs", []), "__comma", ["/"])]);
  1973. return self;}
  1974. }),
  1975. smalltalk.Package.klass);
  1976. smalltalk.addMethod(
  1977. "_fetch_prefix_",
  1978. smalltalk.method({
  1979. selector: "fetch:prefix:",
  1980. fn: function (aPackageName, aPrefix){
  1981. var self=this;
  1982. smalltalk.send((typeof jQuery == 'undefined' ? nil : jQuery), "_getScript_onSuccess_", [smalltalk.send(smalltalk.send(aPrefix, "__comma", [aPackageName]), "__comma", [".js"]), (function(){return smalltalk.send((smalltalk.Package || Package), "_init_", [aPackageName]);})]);
  1983. return self;}
  1984. }),
  1985. smalltalk.Package.klass);
  1986. smalltalk.addMethod(
  1987. "_init_",
  1988. smalltalk.method({
  1989. selector: "init:",
  1990. fn: function (aPackageName){
  1991. var self=this;
  1992. (function($rec){smalltalk.send($rec, "_do_", [(function(each){return smalltalk.init(each);})]);return smalltalk.send($rec, "_do_", [(function(each){return smalltalk.send(each, "_initialize", []);})]);})(smalltalk.send(smalltalk.send((typeof smalltalk == 'undefined' ? nil : smalltalk), "_classes", []), "_select_", [(function(each){return each.pkg.pkgName == aPackageName;})]));
  1993. return self;}
  1994. }),
  1995. smalltalk.Package.klass);
  1996. smalltalk.addMethod(
  1997. "_named_",
  1998. smalltalk.method({
  1999. selector: "named:",
  2000. fn: function (aPackageName){
  2001. var self=this;
  2002. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [aPackageName]);
  2003. return self;}
  2004. }),
  2005. smalltalk.Package.klass);
  2006. smalltalk.addMethod(
  2007. "_named_ifAbsent_",
  2008. smalltalk.method({
  2009. selector: "named:ifAbsent:",
  2010. fn: function (aPackageName, aBlock){
  2011. var self=this;
  2012. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_ifAbsent_", [aPackageName, aBlock]);
  2013. return self;}
  2014. }),
  2015. smalltalk.Package.klass);
  2016. smalltalk.addMethod(
  2017. "_resetCommitPaths",
  2018. smalltalk.method({
  2019. selector: "resetCommitPaths",
  2020. fn: function (){
  2021. var self=this;
  2022. (self['@defaultCommitPathJs']=nil);
  2023. (self['@defaultCommitPathSt']=nil);
  2024. return self;}
  2025. }),
  2026. smalltalk.Package.klass);
  2027. smalltalk.addMethod(
  2028. "_sortedClasses_",
  2029. smalltalk.method({
  2030. selector: "sortedClasses:",
  2031. fn: function (classes){
  2032. var self=this;
  2033. var children=nil;
  2034. var others=nil;
  2035. var nodes=nil;
  2036. var expandedClasses=nil;
  2037. (children=[]);
  2038. (others=[]);
  2039. smalltalk.send(classes, "_do_", [(function(each){return ((($receiver = smalltalk.send(classes, "_includes_", [smalltalk.send(each, "_superclass", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(children, "_add_", [each]);})() : (function(){return smalltalk.send(others, "_add_", [each]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return smalltalk.send(children, "_add_", [each]);}), (function(){return smalltalk.send(others, "_add_", [each]);})]));})]);
  2040. (nodes=smalltalk.send(children, "_collect_", [(function(each){return smalltalk.send((smalltalk.ClassSorterNode || ClassSorterNode), "_on_classes_level_", [each, others, (0)]);})]));
  2041. (nodes=smalltalk.send(nodes, "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(smalltalk.send(a, "_theClass", []), "_name", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", [])]));})]));
  2042. (expandedClasses=smalltalk.send((smalltalk.Array || Array), "_new", []));
  2043. smalltalk.send(nodes, "_do_", [(function(aNode){return smalltalk.send(aNode, "_traverseClassesWith_", [expandedClasses]);})]);
  2044. return expandedClasses;
  2045. return self;}
  2046. }),
  2047. smalltalk.Package.klass);
  2048. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  2049. smalltalk.addMethod(
  2050. "__star",
  2051. smalltalk.method({
  2052. selector: "*",
  2053. fn: function (aPoint){
  2054. var self=this;
  2055. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  2056. return self;}
  2057. }),
  2058. smalltalk.Point);
  2059. smalltalk.addMethod(
  2060. "__plus",
  2061. smalltalk.method({
  2062. selector: "+",
  2063. fn: function (aPoint){
  2064. var self=this;
  2065. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  2066. return self;}
  2067. }),
  2068. smalltalk.Point);
  2069. smalltalk.addMethod(
  2070. "__minus",
  2071. smalltalk.method({
  2072. selector: "-",
  2073. fn: function (aPoint){
  2074. var self=this;
  2075. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  2076. return self;}
  2077. }),
  2078. smalltalk.Point);
  2079. smalltalk.addMethod(
  2080. "__slash",
  2081. smalltalk.method({
  2082. selector: "/",
  2083. fn: function (aPoint){
  2084. var self=this;
  2085. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver /smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver /smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  2086. return self;}
  2087. }),
  2088. smalltalk.Point);
  2089. smalltalk.addMethod(
  2090. "__eq",
  2091. smalltalk.method({
  2092. selector: "=",
  2093. fn: function (aPoint){
  2094. var self=this;
  2095. return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_class", []), "__eq", [smalltalk.send(self, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_x", []), "__eq", [smalltalk.send(self, "_x", [])]), "_&", [smalltalk.send(smalltalk.send(aPoint, "_y", []), "__eq", [smalltalk.send(self, "_y", [])])]);})]);
  2096. return self;}
  2097. }),
  2098. smalltalk.Point);
  2099. smalltalk.addMethod(
  2100. "_asPoint",
  2101. smalltalk.method({
  2102. selector: "asPoint",
  2103. fn: function (){
  2104. var self=this;
  2105. return self;
  2106. return self;}
  2107. }),
  2108. smalltalk.Point);
  2109. smalltalk.addMethod(
  2110. "_printString",
  2111. smalltalk.method({
  2112. selector: "printString",
  2113. fn: function (){
  2114. var self=this;
  2115. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@x'], "_printString", []), "__comma", ["@"])]);((($receiver = smalltalk.send(smalltalk.send(self['@y'], "_notNil", []), "_and_", [(function(){return smalltalk.send(self['@y'], "_negative", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(stream, "_space", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(stream, "_space", []);})]));return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self['@y'], "_printString", [])]);})]);
  2116. return self;}
  2117. }),
  2118. smalltalk.Point);
  2119. smalltalk.addMethod(
  2120. "_translateBy_",
  2121. smalltalk.method({
  2122. selector: "translateBy:",
  2123. fn: function (delta){
  2124. var self=this;
  2125. return smalltalk.send(((($receiver = smalltalk.send(delta, "_x", [])).klass === smalltalk.Number) ? $receiver +self['@x'] : smalltalk.send($receiver, "__plus", [self['@x']])), "__at", [((($receiver = smalltalk.send(delta, "_y", [])).klass === smalltalk.Number) ? $receiver +self['@y'] : smalltalk.send($receiver, "__plus", [self['@y']]))]);
  2126. return self;}
  2127. }),
  2128. smalltalk.Point);
  2129. smalltalk.addMethod(
  2130. "_x",
  2131. smalltalk.method({
  2132. selector: "x",
  2133. fn: function (){
  2134. var self=this;
  2135. return self['@x'];
  2136. return self;}
  2137. }),
  2138. smalltalk.Point);
  2139. smalltalk.addMethod(
  2140. "_x_",
  2141. smalltalk.method({
  2142. selector: "x:",
  2143. fn: function (aNumber){
  2144. var self=this;
  2145. (self['@x']=aNumber);
  2146. return self;}
  2147. }),
  2148. smalltalk.Point);
  2149. smalltalk.addMethod(
  2150. "_y",
  2151. smalltalk.method({
  2152. selector: "y",
  2153. fn: function (){
  2154. var self=this;
  2155. return self['@y'];
  2156. return self;}
  2157. }),
  2158. smalltalk.Point);
  2159. smalltalk.addMethod(
  2160. "_y_",
  2161. smalltalk.method({
  2162. selector: "y:",
  2163. fn: function (aNumber){
  2164. var self=this;
  2165. (self['@y']=aNumber);
  2166. return self;}
  2167. }),
  2168. smalltalk.Point);
  2169. smalltalk.addMethod(
  2170. "_x_y_",
  2171. smalltalk.method({
  2172. selector: "x:y:",
  2173. fn: function (aNumber, anotherNumber){
  2174. var self=this;
  2175. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2176. return self;}
  2177. }),
  2178. smalltalk.Point.klass);
  2179. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  2180. smalltalk.addMethod(
  2181. "_next",
  2182. smalltalk.method({
  2183. selector: "next",
  2184. fn: function (){
  2185. var self=this;
  2186. return Math.random();
  2187. return self;}
  2188. }),
  2189. smalltalk.Random);
  2190. smalltalk.addMethod(
  2191. "_next_",
  2192. smalltalk.method({
  2193. selector: "next:",
  2194. fn: function (anInteger){
  2195. var self=this;
  2196. return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
  2197. return self;}
  2198. }),
  2199. smalltalk.Random);
  2200. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
  2201. smalltalk.addMethod(
  2202. "_at_",
  2203. smalltalk.method({
  2204. selector: "at:",
  2205. fn: function (aString){
  2206. var self=this;
  2207. return self[aString];
  2208. return self;}
  2209. }),
  2210. smalltalk.Smalltalk);
  2211. smalltalk.addMethod(
  2212. "_basicParse_",
  2213. smalltalk.method({
  2214. selector: "basicParse:",
  2215. fn: function (aString){
  2216. var self=this;
  2217. return smalltalk.parser.parse(aString);
  2218. return self;}
  2219. }),
  2220. smalltalk.Smalltalk);
  2221. smalltalk.addMethod(
  2222. "_classes",
  2223. smalltalk.method({
  2224. selector: "classes",
  2225. fn: function (){
  2226. var self=this;
  2227. return self.classes();
  2228. return self;}
  2229. }),
  2230. smalltalk.Smalltalk);
  2231. smalltalk.addMethod(
  2232. "_createPackage_",
  2233. smalltalk.method({
  2234. selector: "createPackage:",
  2235. fn: function (packageName){
  2236. var self=this;
  2237. return smalltalk.addPackage(packageName, nil);
  2238. return self;}
  2239. }),
  2240. smalltalk.Smalltalk);
  2241. smalltalk.addMethod(
  2242. "_createPackage_properties_",
  2243. smalltalk.method({
  2244. selector: "createPackage:properties:",
  2245. fn: function (packageName, aDict){
  2246. var self=this;
  2247. var object=nil;
  2248. object = {};;
  2249. smalltalk.send(aDict, "_keysAndValuesDo_", [(function(key, value){return object[key] = value;})]);
  2250. return smalltalk.addPackage(packageName, object);
  2251. return self;}
  2252. }),
  2253. smalltalk.Smalltalk);
  2254. smalltalk.addMethod(
  2255. "_deletePackage_",
  2256. smalltalk.method({
  2257. selector: "deletePackage:",
  2258. fn: function (packageName){
  2259. var self=this;
  2260. delete smalltalk.packages[packageName];
  2261. return self;}
  2262. }),
  2263. smalltalk.Smalltalk);
  2264. smalltalk.addMethod(
  2265. "_packageAt_",
  2266. smalltalk.method({
  2267. selector: "packageAt:",
  2268. fn: function (packageName){
  2269. var self=this;
  2270. return self.packages[packageName];
  2271. return self;}
  2272. }),
  2273. smalltalk.Smalltalk);
  2274. smalltalk.addMethod(
  2275. "_packageAt_ifAbsent_",
  2276. smalltalk.method({
  2277. selector: "packageAt:ifAbsent:",
  2278. fn: function (packageName, aBlock){
  2279. var self=this;
  2280. return smalltalk.send(smalltalk.send(self, "_packageAt_", [packageName]), "_ifNil_", [aBlock]);
  2281. return self;}
  2282. }),
  2283. smalltalk.Smalltalk);
  2284. smalltalk.addMethod(
  2285. "_packages",
  2286. smalltalk.method({
  2287. selector: "packages",
  2288. fn: function (){
  2289. var self=this;
  2290. return self.packages.all();
  2291. return self;}
  2292. }),
  2293. smalltalk.Smalltalk);
  2294. smalltalk.addMethod(
  2295. "_parse_",
  2296. smalltalk.method({
  2297. selector: "parse:",
  2298. fn: function (aString){
  2299. var self=this;
  2300. var result=nil;
  2301. smalltalk.send(self, "_try_catch_", [(function(){return (result=smalltalk.send(self, "_basicParse_", [aString]));}), (function(ex){return smalltalk.send(smalltalk.send(self, "_parseError_parsing_", [ex, aString]), "_signal", []);})]);
  2302. return result;
  2303. return self;}
  2304. }),
  2305. smalltalk.Smalltalk);
  2306. smalltalk.addMethod(
  2307. "_parseError_parsing_",
  2308. smalltalk.method({
  2309. selector: "parseError:parsing:",
  2310. fn: function (anException, aString){
  2311. var self=this;
  2312. var row=nil;
  2313. var col=nil;
  2314. var message=nil;
  2315. var lines=nil;
  2316. var badLine=nil;
  2317. var code=nil;
  2318. row = anException.line;
  2319. col = anException.column;
  2320. message = anException.message;;
  2321. (lines=smalltalk.send(aString, "_lines", []));
  2322. (badLine=smalltalk.send(lines, "_at_", [row]));
  2323. (badLine=smalltalk.send(smalltalk.send(smalltalk.send(badLine, "_copyFrom_to_", [(1), ((($receiver = col).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]), "__comma", [" ===>"]), "__comma", [smalltalk.send(badLine, "_copyFrom_to_", [col, smalltalk.send(badLine, "_size", [])])]));
  2324. smalltalk.send(lines, "_at_put_", [row, badLine]);
  2325. (code=smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(s){return smalltalk.send(lines, "_withIndexDo_", [(function(l, i){return smalltalk.send(s, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(i, "_asString", []), "__comma", [": "]), "__comma", [l]), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])])]);})]);})]));
  2326. return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_messageText_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("Parse error on line ", "__comma", [row]), "__comma", [" column "]), "__comma", [col]), "__comma", [" : "]), "__comma", [message]), "__comma", [" Below is code with line numbers and ===> marker inserted:"]), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", [code])]);
  2327. return self;}
  2328. }),
  2329. smalltalk.Smalltalk);
  2330. smalltalk.addMethod(
  2331. "_readJSObject_",
  2332. smalltalk.method({
  2333. selector: "readJSObject:",
  2334. fn: function (anObject){
  2335. var self=this;
  2336. return self.readJSObject(anObject);
  2337. return self;}
  2338. }),
  2339. smalltalk.Smalltalk);
  2340. smalltalk.addMethod(
  2341. "_removeClass_",
  2342. smalltalk.method({
  2343. selector: "removeClass:",
  2344. fn: function (aClass){
  2345. var self=this;
  2346. ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [" is a Metaclass and cannot be removed!"])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [" is a Metaclass and cannot be removed!"])]);})]));
  2347. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);})]);
  2348. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);})]);
  2349. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  2350. return self;}
  2351. }),
  2352. smalltalk.Smalltalk);
  2353. smalltalk.addMethod(
  2354. "_removePackage_",
  2355. smalltalk.method({
  2356. selector: "removePackage:",
  2357. fn: function (packageName){
  2358. var self=this;
  2359. var pkg=nil;
  2360. (pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]));
  2361. smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_removeClass_", [each]);})]);
  2362. smalltalk.send(self, "_deletePackage_", [packageName]);
  2363. return self;}
  2364. }),
  2365. smalltalk.Smalltalk);
  2366. smalltalk.addMethod(
  2367. "_renamePackage_to_",
  2368. smalltalk.method({
  2369. selector: "renamePackage:to:",
  2370. fn: function (packageName, newName){
  2371. var self=this;
  2372. var pkg=nil;
  2373. (pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]));
  2374. (($receiver = smalltalk.send(self, "_packageAt_", [newName])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Already exists a package called: ", "__comma", [newName])]);})() : nil;
  2375. smalltalk.packages[newName] = smalltalk.packages[packageName];
  2376. smalltalk.send(pkg, "_name_", [newName]);
  2377. smalltalk.send(self, "_deletePackage_", [packageName]);
  2378. return self;}
  2379. }),
  2380. smalltalk.Smalltalk);
  2381. smalltalk.addMethod(
  2382. "_reservedWords",
  2383. smalltalk.method({
  2384. selector: "reservedWords",
  2385. fn: function (){
  2386. var self=this;
  2387. return self.reservedWords;
  2388. return self;}
  2389. }),
  2390. smalltalk.Smalltalk);
  2391. smalltalk.addMethod(
  2392. "_send_to_arguments_",
  2393. smalltalk.method({
  2394. selector: "send:to:arguments:",
  2395. fn: function (aSelector, anObject, aCollection){
  2396. var self=this;
  2397. var selector=nil;
  2398. (selector=smalltalk.send(smalltalk.send(aSelector, "_asString", []), "_asSelector", []));
  2399. self.send(anObject, selector, aCollection);
  2400. return self;}
  2401. }),
  2402. smalltalk.Smalltalk);
  2403. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  2404. smalltalk.addMethod(
  2405. "_current",
  2406. smalltalk.method({
  2407. selector: "current",
  2408. fn: function (){
  2409. var self=this;
  2410. return smalltalk;
  2411. return self;}
  2412. }),
  2413. smalltalk.Smalltalk.klass);
  2414. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  2415. smalltalk.addMethod(
  2416. "_asJSON",
  2417. smalltalk.method({
  2418. selector: "asJSON",
  2419. fn: function (){
  2420. var self=this;
  2421. return (typeof null == 'undefined' ? nil : null);
  2422. return self;}
  2423. }),
  2424. smalltalk.UndefinedObject);
  2425. smalltalk.addMethod(
  2426. "_deepCopy",
  2427. smalltalk.method({
  2428. selector: "deepCopy",
  2429. fn: function (){
  2430. var self=this;
  2431. return self;
  2432. return self;}
  2433. }),
  2434. smalltalk.UndefinedObject);
  2435. smalltalk.addMethod(
  2436. "_ifNil_",
  2437. smalltalk.method({
  2438. selector: "ifNil:",
  2439. fn: function (aBlock){
  2440. var self=this;
  2441. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2442. return self;}
  2443. }),
  2444. smalltalk.UndefinedObject);
  2445. smalltalk.addMethod(
  2446. "_ifNil_ifNotNil_",
  2447. smalltalk.method({
  2448. selector: "ifNil:ifNotNil:",
  2449. fn: function (aBlock, anotherBlock){
  2450. var self=this;
  2451. return smalltalk.send(aBlock, "_value", []);
  2452. return self;}
  2453. }),
  2454. smalltalk.UndefinedObject);
  2455. smalltalk.addMethod(
  2456. "_ifNotNil_",
  2457. smalltalk.method({
  2458. selector: "ifNotNil:",
  2459. fn: function (aBlock){
  2460. var self=this;
  2461. return self;
  2462. return self;}
  2463. }),
  2464. smalltalk.UndefinedObject);
  2465. smalltalk.addMethod(
  2466. "_ifNotNil_ifNil_",
  2467. smalltalk.method({
  2468. selector: "ifNotNil:ifNil:",
  2469. fn: function (aBlock, anotherBlock){
  2470. var self=this;
  2471. return smalltalk.send(anotherBlock, "_value", []);
  2472. return self;}
  2473. }),
  2474. smalltalk.UndefinedObject);
  2475. smalltalk.addMethod(
  2476. "_isNil",
  2477. smalltalk.method({
  2478. selector: "isNil",
  2479. fn: function (){
  2480. var self=this;
  2481. return true;
  2482. return self;}
  2483. }),
  2484. smalltalk.UndefinedObject);
  2485. smalltalk.addMethod(
  2486. "_notNil",
  2487. smalltalk.method({
  2488. selector: "notNil",
  2489. fn: function (){
  2490. var self=this;
  2491. return false;
  2492. return self;}
  2493. }),
  2494. smalltalk.UndefinedObject);
  2495. smalltalk.addMethod(
  2496. "_printString",
  2497. smalltalk.method({
  2498. selector: "printString",
  2499. fn: function (){
  2500. var self=this;
  2501. return "nil";
  2502. return self;}
  2503. }),
  2504. smalltalk.UndefinedObject);
  2505. smalltalk.addMethod(
  2506. "_shallowCopy",
  2507. smalltalk.method({
  2508. selector: "shallowCopy",
  2509. fn: function (){
  2510. var self=this;
  2511. return self;
  2512. return self;}
  2513. }),
  2514. smalltalk.UndefinedObject);
  2515. smalltalk.addMethod(
  2516. "_subclass_instanceVariableNames_",
  2517. smalltalk.method({
  2518. selector: "subclass:instanceVariableNames:",
  2519. fn: function (aString, anotherString){
  2520. var self=this;
  2521. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  2522. return self;}
  2523. }),
  2524. smalltalk.UndefinedObject);
  2525. smalltalk.addMethod(
  2526. "_subclass_instanceVariableNames_category_",
  2527. smalltalk.method({
  2528. selector: "subclass:instanceVariableNames:category:",
  2529. fn: function (aString, aString2, aString3){
  2530. var self=this;
  2531. smalltalk.send(self, "_deprecatedAPI", []);
  2532. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  2533. return self;}
  2534. }),
  2535. smalltalk.UndefinedObject);
  2536. smalltalk.addMethod(
  2537. "_subclass_instanceVariableNames_package_",
  2538. smalltalk.method({
  2539. selector: "subclass:instanceVariableNames:package:",
  2540. fn: function (aString, aString2, aString3){
  2541. var self=this;
  2542. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  2543. return self;}
  2544. }),
  2545. smalltalk.UndefinedObject);
  2546. smalltalk.addMethod(
  2547. "_new",
  2548. smalltalk.method({
  2549. selector: "new",
  2550. fn: function (){
  2551. var self=this;
  2552. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2553. return self;}
  2554. }),
  2555. smalltalk.UndefinedObject.klass);