Kernel-Objects.deploy.js 69 KB

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