Kernel-Objects.deploy.js 69 KB

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