1
0

Kernel-Objects.deploy.js 61 KB

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