1
0

Kernel-Objects.deploy.js 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393
  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. "_copy",
  1644. smalltalk.method({
  1645. selector: "copy",
  1646. fn: function () {
  1647. var self = this;
  1648. return self;
  1649. }
  1650. }),
  1651. smalltalk.Number);
  1652. smalltalk.addMethod(
  1653. "_deepCopy",
  1654. smalltalk.method({
  1655. selector: "deepCopy",
  1656. fn: function () {
  1657. var self = this;
  1658. var $1;
  1659. $1 = smalltalk.send(self, "_copy", []);
  1660. return $1;
  1661. }
  1662. }),
  1663. smalltalk.Number);
  1664. smalltalk.addMethod(
  1665. "_even",
  1666. smalltalk.method({
  1667. selector: "even",
  1668. fn: function () {
  1669. var self = this;
  1670. var $1;
  1671. $1 = smalltalk.send(0, "__eq", [smalltalk.send(self, "_\\\\", [2])]);
  1672. return $1;
  1673. }
  1674. }),
  1675. smalltalk.Number);
  1676. smalltalk.addMethod(
  1677. "_identityHash",
  1678. smalltalk.method({
  1679. selector: "identityHash",
  1680. fn: function () {
  1681. var self = this;
  1682. var $1;
  1683. $1 = smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", ["n"]);
  1684. return $1;
  1685. }
  1686. }),
  1687. smalltalk.Number);
  1688. smalltalk.addMethod(
  1689. "_isNumber",
  1690. smalltalk.method({
  1691. selector: "isNumber",
  1692. fn: function () {
  1693. var self = this;
  1694. return true;
  1695. }
  1696. }),
  1697. smalltalk.Number);
  1698. smalltalk.addMethod(
  1699. "_isZero",
  1700. smalltalk.method({
  1701. selector: "isZero",
  1702. fn: function () {
  1703. var self = this;
  1704. var $1;
  1705. $1 = smalltalk.send(self, "__eq", [0]);
  1706. return $1;
  1707. }
  1708. }),
  1709. smalltalk.Number);
  1710. smalltalk.addMethod(
  1711. "_max_",
  1712. smalltalk.method({
  1713. selector: "max:",
  1714. fn: function (aNumber) {
  1715. var self = this;
  1716. return Math.max(self, aNumber);
  1717. return self;
  1718. }
  1719. }),
  1720. smalltalk.Number);
  1721. smalltalk.addMethod(
  1722. "_min_",
  1723. smalltalk.method({
  1724. selector: "min:",
  1725. fn: function (aNumber) {
  1726. var self = this;
  1727. return Math.min(self, aNumber);
  1728. return self;
  1729. }
  1730. }),
  1731. smalltalk.Number);
  1732. smalltalk.addMethod(
  1733. "_negated",
  1734. smalltalk.method({
  1735. selector: "negated",
  1736. fn: function () {
  1737. var self = this;
  1738. var $1;
  1739. $1 = smalltalk.send(0, "__minus", [self]);
  1740. return $1;
  1741. }
  1742. }),
  1743. smalltalk.Number);
  1744. smalltalk.addMethod(
  1745. "_negative",
  1746. smalltalk.method({
  1747. selector: "negative",
  1748. fn: function () {
  1749. var self = this;
  1750. var $1;
  1751. $1 = smalltalk.send(self, "__lt", [0]);
  1752. return $1;
  1753. }
  1754. }),
  1755. smalltalk.Number);
  1756. smalltalk.addMethod(
  1757. "_odd",
  1758. smalltalk.method({
  1759. selector: "odd",
  1760. fn: function () {
  1761. var self = this;
  1762. var $1;
  1763. $1 = smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1764. return $1;
  1765. }
  1766. }),
  1767. smalltalk.Number);
  1768. smalltalk.addMethod(
  1769. "_positive",
  1770. smalltalk.method({
  1771. selector: "positive",
  1772. fn: function () {
  1773. var self = this;
  1774. var $1;
  1775. $1 = smalltalk.send(self, "__gt_eq", [0]);
  1776. return $1;
  1777. }
  1778. }),
  1779. smalltalk.Number);
  1780. smalltalk.addMethod(
  1781. "_printShowingDecimalPlaces_",
  1782. smalltalk.method({
  1783. selector: "printShowingDecimalPlaces:",
  1784. fn: function (placesDesired) {
  1785. var self = this;
  1786. return self.toFixed(placesDesired);
  1787. return self;
  1788. }
  1789. }),
  1790. smalltalk.Number);
  1791. smalltalk.addMethod(
  1792. "_printString",
  1793. smalltalk.method({
  1794. selector: "printString",
  1795. fn: function () {
  1796. var self = this;
  1797. return String(self);
  1798. return self;
  1799. }
  1800. }),
  1801. smalltalk.Number);
  1802. smalltalk.addMethod(
  1803. "_rounded",
  1804. smalltalk.method({
  1805. selector: "rounded",
  1806. fn: function () {
  1807. var self = this;
  1808. return Math.round(self);
  1809. return self;
  1810. }
  1811. }),
  1812. smalltalk.Number);
  1813. smalltalk.addMethod(
  1814. "_sqrt",
  1815. smalltalk.method({
  1816. selector: "sqrt",
  1817. fn: function () {
  1818. var self = this;
  1819. return Math.sqrt(self);
  1820. return self;
  1821. }
  1822. }),
  1823. smalltalk.Number);
  1824. smalltalk.addMethod(
  1825. "_squared",
  1826. smalltalk.method({
  1827. selector: "squared",
  1828. fn: function () {
  1829. var self = this;
  1830. var $1;
  1831. $1 = smalltalk.send(self, "__star", [self]);
  1832. return $1;
  1833. }
  1834. }),
  1835. smalltalk.Number);
  1836. smalltalk.addMethod(
  1837. "_timesRepeat_",
  1838. smalltalk.method({
  1839. selector: "timesRepeat:",
  1840. fn: function (aBlock) {
  1841. var self = this;
  1842. var integer;
  1843. var count;
  1844. integer = smalltalk.send(self, "_truncated", []);
  1845. count = 1;
  1846. smalltalk.send(function () {return smalltalk.send(count, "__gt", [self]);}, "_whileFalse_", [function () {smalltalk.send(aBlock, "_value", []);count = smalltalk.send(count, "__plus", [1]);return count;}]);
  1847. return self;
  1848. }
  1849. }),
  1850. smalltalk.Number);
  1851. smalltalk.addMethod(
  1852. "_to_",
  1853. smalltalk.method({
  1854. selector: "to:",
  1855. fn: function (aNumber) {
  1856. var self = this;
  1857. var array;
  1858. var first;
  1859. var last;
  1860. var count;
  1861. first = smalltalk.send(self, "_truncated", []);
  1862. last = smalltalk.send(smalltalk.send(aNumber, "_truncated", []), "__plus", [1]);
  1863. count = 1;
  1864. array = smalltalk.send(smalltalk.Array || Array, "_new", []);
  1865. 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;}]);
  1866. return array;
  1867. }
  1868. }),
  1869. smalltalk.Number);
  1870. smalltalk.addMethod(
  1871. "_to_by_",
  1872. smalltalk.method({
  1873. selector: "to:by:",
  1874. fn: function (stop, step) {
  1875. var self = this;
  1876. var $1, $2;
  1877. var array;
  1878. var value;
  1879. var pos;
  1880. value = self;
  1881. array = smalltalk.send(smalltalk.Array || Array, "_new", []);
  1882. pos = 1;
  1883. $1 = smalltalk.send(step, "__eq", [0]);
  1884. if (smalltalk.assert($1)) {
  1885. smalltalk.send(self, "_error_", ["step must be non-zero"]);
  1886. }
  1887. $2 = smalltalk.send(step, "__lt", [0]);
  1888. if (smalltalk.assert($2)) {
  1889. 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;}]);
  1890. } else {
  1891. 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;}]);
  1892. }
  1893. return array;
  1894. }
  1895. }),
  1896. smalltalk.Number);
  1897. smalltalk.addMethod(
  1898. "_to_by_do_",
  1899. smalltalk.method({
  1900. selector: "to:by:do:",
  1901. fn: function (stop, step, aBlock) {
  1902. var self = this;
  1903. var $1, $2;
  1904. var value;
  1905. value = self;
  1906. $1 = smalltalk.send(step, "__eq", [0]);
  1907. if (smalltalk.assert($1)) {
  1908. smalltalk.send(self, "_error_", ["step must be non-zero"]);
  1909. }
  1910. $2 = smalltalk.send(step, "__lt", [0]);
  1911. if (smalltalk.assert($2)) {
  1912. 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;}]);
  1913. } else {
  1914. 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;}]);
  1915. }
  1916. return self;
  1917. }
  1918. }),
  1919. smalltalk.Number);
  1920. smalltalk.addMethod(
  1921. "_to_do_",
  1922. smalltalk.method({
  1923. selector: "to:do:",
  1924. fn: function (stop, aBlock) {
  1925. var self = this;
  1926. var nextValue;
  1927. nextValue = self;
  1928. 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;}]);
  1929. return self;
  1930. }
  1931. }),
  1932. smalltalk.Number);
  1933. smalltalk.addMethod(
  1934. "_truncated",
  1935. smalltalk.method({
  1936. selector: "truncated",
  1937. fn: function () {
  1938. var self = this;
  1939. var $1;
  1940. var result;
  1941. $1 = smalltalk.send(self, "__gt_eq", [0]);
  1942. if (smalltalk.assert($1)) {
  1943. result = Math.floor(self);
  1944. } else {
  1945. result = Math.floor(self * -1) * -1;
  1946. }
  1947. return result;
  1948. }
  1949. }),
  1950. smalltalk.Number);
  1951. smalltalk.addMethod(
  1952. "_|",
  1953. smalltalk.method({
  1954. selector: "|",
  1955. fn: function (aNumber) {
  1956. var self = this;
  1957. return self | aNumber;
  1958. return self;
  1959. }
  1960. }),
  1961. smalltalk.Number);
  1962. smalltalk.addMethod(
  1963. "_pi",
  1964. smalltalk.method({
  1965. selector: "pi",
  1966. fn: function () {
  1967. var self = this;
  1968. return Math.PI;
  1969. return self;
  1970. }
  1971. }),
  1972. smalltalk.Number.klass);
  1973. smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Objects');
  1974. smalltalk.addMethod(
  1975. "_addElement_",
  1976. smalltalk.method({
  1977. selector: "addElement:",
  1978. fn: function (anObject) {
  1979. var self = this;
  1980. self.addElement(anObject);
  1981. return self;
  1982. }
  1983. }),
  1984. smalltalk.Organizer);
  1985. smalltalk.addMethod(
  1986. "_elements",
  1987. smalltalk.method({
  1988. selector: "elements",
  1989. fn: function () {
  1990. var self = this;
  1991. var $1;
  1992. $1 = smalltalk.send(smalltalk.send(self, "_basicAt_", ["elements"]), "_copy", []);
  1993. return $1;
  1994. }
  1995. }),
  1996. smalltalk.Organizer);
  1997. smalltalk.addMethod(
  1998. "_removeElement_",
  1999. smalltalk.method({
  2000. selector: "removeElement:",
  2001. fn: function (anObject) {
  2002. var self = this;
  2003. self.removeElement(anObject);
  2004. return self;
  2005. }
  2006. }),
  2007. smalltalk.Organizer);
  2008. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
  2009. smalltalk.addMethod(
  2010. "_classes",
  2011. smalltalk.method({
  2012. selector: "classes",
  2013. fn: function () {
  2014. var self = this;
  2015. var $1;
  2016. $1 = smalltalk.send(smalltalk.send(self, "_organization", []), "_elements", []);
  2017. return $1;
  2018. }
  2019. }),
  2020. smalltalk.Package);
  2021. smalltalk.addMethod(
  2022. "_commitPathJs",
  2023. smalltalk.method({
  2024. selector: "commitPathJs",
  2025. fn: function () {
  2026. var self = this;
  2027. var $1;
  2028. if (($receiver = self['@commitPathJs']) == nil ||
  2029. $receiver == undefined) {
  2030. $1 = smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathJs", []);
  2031. } else {
  2032. $1 = self['@commitPathJs'];
  2033. }
  2034. return $1;
  2035. }
  2036. }),
  2037. smalltalk.Package);
  2038. smalltalk.addMethod(
  2039. "_commitPathJs_",
  2040. smalltalk.method({
  2041. selector: "commitPathJs:",
  2042. fn: function (aString) {
  2043. var self = this;
  2044. self['@commitPathJs'] = aString;
  2045. return self;
  2046. }
  2047. }),
  2048. smalltalk.Package);
  2049. smalltalk.addMethod(
  2050. "_commitPathSt",
  2051. smalltalk.method({
  2052. selector: "commitPathSt",
  2053. fn: function () {
  2054. var self = this;
  2055. var $1;
  2056. if (($receiver = self['@commitPathSt']) == nil ||
  2057. $receiver == undefined) {
  2058. $1 = smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathSt", []);
  2059. } else {
  2060. $1 = self['@commitPathSt'];
  2061. }
  2062. return $1;
  2063. }
  2064. }),
  2065. smalltalk.Package);
  2066. smalltalk.addMethod(
  2067. "_commitPathSt_",
  2068. smalltalk.method({
  2069. selector: "commitPathSt:",
  2070. fn: function (aString) {
  2071. var self = this;
  2072. self['@commitPathSt'] = aString;
  2073. return self;
  2074. }
  2075. }),
  2076. smalltalk.Package);
  2077. smalltalk.addMethod(
  2078. "_dependencies",
  2079. smalltalk.method({
  2080. selector: "dependencies",
  2081. fn: function () {
  2082. var self = this;
  2083. var $1;
  2084. $1 = smalltalk.send(self, "_propertyAt_ifAbsent_", ["dependencies", function () {return [];}]);
  2085. return $1;
  2086. }
  2087. }),
  2088. smalltalk.Package);
  2089. smalltalk.addMethod(
  2090. "_dependencies_",
  2091. smalltalk.method({
  2092. selector: "dependencies:",
  2093. fn: function (anArray) {
  2094. var self = this;
  2095. var $1;
  2096. $1 = smalltalk.send(self, "_propertyAt_put_", ["dependencies", anArray]);
  2097. return $1;
  2098. }
  2099. }),
  2100. smalltalk.Package);
  2101. smalltalk.addMethod(
  2102. "_jsProperties",
  2103. smalltalk.method({
  2104. selector: "jsProperties",
  2105. fn: function () {
  2106. var self = this;
  2107. return self.properties;
  2108. return self;
  2109. }
  2110. }),
  2111. smalltalk.Package);
  2112. smalltalk.addMethod(
  2113. "_jsProperties_",
  2114. smalltalk.method({
  2115. selector: "jsProperties:",
  2116. fn: function (aJSObject) {
  2117. var self = this;
  2118. return self.properties = aJSObject;
  2119. return self;
  2120. }
  2121. }),
  2122. smalltalk.Package);
  2123. smalltalk.addMethod(
  2124. "_name",
  2125. smalltalk.method({
  2126. selector: "name",
  2127. fn: function () {
  2128. var self = this;
  2129. return self.pkgName;
  2130. return self;
  2131. }
  2132. }),
  2133. smalltalk.Package);
  2134. smalltalk.addMethod(
  2135. "_name_",
  2136. smalltalk.method({
  2137. selector: "name:",
  2138. fn: function (aString) {
  2139. var self = this;
  2140. self.pkgName = aString;
  2141. return self;
  2142. }
  2143. }),
  2144. smalltalk.Package);
  2145. smalltalk.addMethod(
  2146. "_organization",
  2147. smalltalk.method({
  2148. selector: "organization",
  2149. fn: function () {
  2150. var self = this;
  2151. var $1;
  2152. $1 = smalltalk.send(self, "_basicAt_", ["organization"]);
  2153. return $1;
  2154. }
  2155. }),
  2156. smalltalk.Package);
  2157. smalltalk.addMethod(
  2158. "_printString",
  2159. smalltalk.method({
  2160. selector: "printString",
  2161. fn: function () {
  2162. var self = this;
  2163. var $1;
  2164. $1 = smalltalk.send(self, "_name", []);
  2165. return $1;
  2166. }
  2167. }),
  2168. smalltalk.Package);
  2169. smalltalk.addMethod(
  2170. "_properties",
  2171. smalltalk.method({
  2172. selector: "properties",
  2173. fn: function () {
  2174. var self = this;
  2175. var $1;
  2176. $1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_readJSObject_", [smalltalk.send(self, "_basicAt_", ["properties"])]);
  2177. return $1;
  2178. }
  2179. }),
  2180. smalltalk.Package);
  2181. smalltalk.addMethod(
  2182. "_properties_",
  2183. smalltalk.method({
  2184. selector: "properties:",
  2185. fn: function (aDict) {
  2186. var self = this;
  2187. var object;
  2188. object = {};
  2189. smalltalk.send(aDict, "_keysAndValuesDo_", [function (key, value) {return object[key] = value;}]);
  2190. return self.properties = object;
  2191. return self;
  2192. }
  2193. }),
  2194. smalltalk.Package);
  2195. smalltalk.addMethod(
  2196. "_propertiesAsJSON",
  2197. smalltalk.method({
  2198. selector: "propertiesAsJSON",
  2199. fn: function () {
  2200. var self = this;
  2201. return JSON.stringify(self.properties);
  2202. return self;
  2203. }
  2204. }),
  2205. smalltalk.Package);
  2206. smalltalk.addMethod(
  2207. "_propertyAt_",
  2208. smalltalk.method({
  2209. selector: "propertyAt:",
  2210. fn: function (key) {
  2211. var self = this;
  2212. return self.properties[key];
  2213. return self;
  2214. }
  2215. }),
  2216. smalltalk.Package);
  2217. smalltalk.addMethod(
  2218. "_propertyAt_ifAbsent_",
  2219. smalltalk.method({
  2220. selector: "propertyAt:ifAbsent:",
  2221. fn: function (key, block) {
  2222. var self = this;
  2223. var $2, $1;
  2224. $2 = smalltalk.send(self, "_propertyAt_", [key]);
  2225. if (($receiver = $2) == nil || $receiver == undefined) {
  2226. $1 = smalltalk.send(block, "_value", []);
  2227. } else {
  2228. $1 = $2;
  2229. }
  2230. return $1;
  2231. }
  2232. }),
  2233. smalltalk.Package);
  2234. smalltalk.addMethod(
  2235. "_propertyAt_put_",
  2236. smalltalk.method({
  2237. selector: "propertyAt:put:",
  2238. fn: function (key, value) {
  2239. var self = this;
  2240. return self.properties[key] = value;
  2241. return self;
  2242. }
  2243. }),
  2244. smalltalk.Package);
  2245. smalltalk.addMethod(
  2246. "_sortedClasses",
  2247. smalltalk.method({
  2248. selector: "sortedClasses",
  2249. fn: function () {
  2250. var self = this;
  2251. var $1;
  2252. $1 = smalltalk.send(smalltalk.send(self, "_class", []), "_sortedClasses_", [smalltalk.send(self, "_classes", [])]);
  2253. return $1;
  2254. }
  2255. }),
  2256. smalltalk.Package);
  2257. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  2258. smalltalk.addMethod(
  2259. "_commitPathsFromLoader",
  2260. smalltalk.method({
  2261. selector: "commitPathsFromLoader",
  2262. fn: function (){
  2263. var self=this;
  2264. var $1,$2;
  2265. var js;
  2266. var st;
  2267. var cp = smalltalk['@@commitPath'];
  2268. if (cp) { js = cp.js; st = cp.st; };
  2269. ;
  2270. $1=js;
  2271. if(($receiver = $1) == nil || $receiver == undefined){
  2272. $1;
  2273. } else {
  2274. smalltalk.send(self,"_defaultCommitPathJs_",[js]);
  2275. };
  2276. $2=st;
  2277. if(($receiver = $2) == nil || $receiver == undefined){
  2278. $2;
  2279. } else {
  2280. smalltalk.send(self,"_defaultCommitPathSt_",[st]);
  2281. };
  2282. return self}
  2283. }),
  2284. smalltalk.Package.klass);
  2285. smalltalk.addMethod(
  2286. "_commitToLocalStorage_",
  2287. smalltalk.method({
  2288. selector: "commitToLocalStorage:",
  2289. fn: function (aPackageName) {
  2290. var self = this;
  2291. var key;
  2292. var sourceCode;
  2293. key = smalltalk.send("smalltalk.packages.", "__comma", [aPackageName]);
  2294. sourceCode = smalltalk.send(smalltalk.send(smalltalk.Exporter || Exporter, "_new", []), "_exportPackage_", [aPackageName]);
  2295. localStorage[key] = escape(sourceCode);
  2296. return self;
  2297. }
  2298. }),
  2299. smalltalk.Package.klass);
  2300. smalltalk.addMethod(
  2301. "_defaultCommitPathJs",
  2302. smalltalk.method({
  2303. selector: "defaultCommitPathJs",
  2304. fn: function () {
  2305. var self = this;
  2306. var $1;
  2307. if (($receiver = self['@defaultCommitPathJs']) == nil ||
  2308. $receiver == undefined) {
  2309. self['@defaultCommitPathJs'] = "js";
  2310. $1 = self['@defaultCommitPathJs'];
  2311. } else {
  2312. $1 = self['@defaultCommitPathJs'];
  2313. }
  2314. return $1;
  2315. }
  2316. }),
  2317. smalltalk.Package.klass);
  2318. smalltalk.addMethod(
  2319. "_defaultCommitPathJs_",
  2320. smalltalk.method({
  2321. selector: "defaultCommitPathJs:",
  2322. fn: function (aString) {
  2323. var self = this;
  2324. self['@defaultCommitPathJs'] = aString;
  2325. return self;
  2326. }
  2327. }),
  2328. smalltalk.Package.klass);
  2329. smalltalk.addMethod(
  2330. "_defaultCommitPathSt",
  2331. smalltalk.method({
  2332. selector: "defaultCommitPathSt",
  2333. fn: function () {
  2334. var self = this;
  2335. var $1;
  2336. if (($receiver = self['@defaultCommitPathSt']) == nil ||
  2337. $receiver == undefined) {
  2338. self['@defaultCommitPathSt'] = "st";
  2339. $1 = self['@defaultCommitPathSt'];
  2340. } else {
  2341. $1 = self['@defaultCommitPathSt'];
  2342. }
  2343. return $1;
  2344. }
  2345. }),
  2346. smalltalk.Package.klass);
  2347. smalltalk.addMethod(
  2348. "_defaultCommitPathSt_",
  2349. smalltalk.method({
  2350. selector: "defaultCommitPathSt:",
  2351. fn: function (aString) {
  2352. var self = this;
  2353. self['@defaultCommitPathSt'] = aString;
  2354. return self;
  2355. }
  2356. }),
  2357. smalltalk.Package.klass);
  2358. smalltalk.addMethod(
  2359. "_fetch_",
  2360. smalltalk.method({
  2361. selector: "fetch:",
  2362. fn: function (aPackageName) {
  2363. var self = this;
  2364. smalltalk.send(self, "_fetch_prefix_", [aPackageName, smalltalk.send(smalltalk.send(self, "_defaultCommitPathJs", []), "__comma", ["/"])]);
  2365. return self;
  2366. }
  2367. }),
  2368. smalltalk.Package.klass);
  2369. smalltalk.addMethod(
  2370. "_fetch_prefix_",
  2371. smalltalk.method({
  2372. selector: "fetch:prefix:",
  2373. fn: function (aPackageName, aPrefix) {
  2374. var self = this;
  2375. smalltalk.send(jQuery, "_getScript_onSuccess_", [smalltalk.send(smalltalk.send(aPrefix, "__comma", [aPackageName]), "__comma", [".js"]), function () {return smalltalk.send(smalltalk.Package || Package, "_init_", [aPackageName]);}]);
  2376. return self;
  2377. }
  2378. }),
  2379. smalltalk.Package.klass);
  2380. smalltalk.addMethod(
  2381. "_init_",
  2382. smalltalk.method({
  2383. selector: "init:",
  2384. fn: function (aPackageName) {
  2385. var self = this;
  2386. var $1, $2;
  2387. $1 = smalltalk.send(smalltalk.send(smalltalk, "_classes", []), "_select_", [function (each) {return each.pkg.pkgName == aPackageName;}]);
  2388. smalltalk.send($1, "_do_", [function (each) {return smalltalk.init(each);}]);
  2389. $2 = smalltalk.send($1, "_do_", [function (each) {return smalltalk.send(each, "_initialize", []);}]);
  2390. return self;
  2391. }
  2392. }),
  2393. smalltalk.Package.klass);
  2394. smalltalk.addMethod(
  2395. "_initialize",
  2396. smalltalk.method({
  2397. selector: "initialize",
  2398. fn: function (){
  2399. var self=this;
  2400. smalltalk.send(self,"_initialize",[],smalltalk.Object.klass);
  2401. smalltalk.send(self,"_commitPathsFromLoader",[]);
  2402. return self}
  2403. }),
  2404. smalltalk.Package.klass);
  2405. smalltalk.addMethod(
  2406. "_named_",
  2407. smalltalk.method({
  2408. selector: "named:",
  2409. fn: function (aPackageName) {
  2410. var self = this;
  2411. var $1;
  2412. $1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packageAt_", [aPackageName]);
  2413. return $1;
  2414. }
  2415. }),
  2416. smalltalk.Package.klass);
  2417. smalltalk.addMethod(
  2418. "_named_ifAbsent_",
  2419. smalltalk.method({
  2420. selector: "named:ifAbsent:",
  2421. fn: function (aPackageName, aBlock) {
  2422. var self = this;
  2423. var $1;
  2424. $1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packageAt_ifAbsent_", [aPackageName, aBlock]);
  2425. return $1;
  2426. }
  2427. }),
  2428. smalltalk.Package.klass);
  2429. smalltalk.addMethod(
  2430. "_resetCommitPaths",
  2431. smalltalk.method({
  2432. selector: "resetCommitPaths",
  2433. fn: function () {
  2434. var self = this;
  2435. self['@defaultCommitPathJs'] = nil;
  2436. self['@defaultCommitPathSt'] = nil;
  2437. return self;
  2438. }
  2439. }),
  2440. smalltalk.Package.klass);
  2441. smalltalk.addMethod(
  2442. "_sortedClasses_",
  2443. smalltalk.method({
  2444. selector: "sortedClasses:",
  2445. fn: function (classes) {
  2446. var self = this;
  2447. var $1;
  2448. var children;
  2449. var others;
  2450. var nodes;
  2451. var expandedClasses;
  2452. children = [];
  2453. others = [];
  2454. 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]);}}]);
  2455. nodes = smalltalk.send(children, "_collect_", [function (each) {return smalltalk.send(smalltalk.ClassSorterNode || ClassSorterNode, "_on_classes_level_", [each, others, 0]);}]);
  2456. 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", [])]);}]);
  2457. expandedClasses = smalltalk.send(smalltalk.Array || Array, "_new", []);
  2458. smalltalk.send(nodes, "_do_", [function (aNode) {return smalltalk.send(aNode, "_traverseClassesWith_", [expandedClasses]);}]);
  2459. return expandedClasses;
  2460. }
  2461. }),
  2462. smalltalk.Package.klass);
  2463. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  2464. smalltalk.addMethod(
  2465. "__star",
  2466. smalltalk.method({
  2467. selector: "*",
  2468. fn: function (aPoint) {
  2469. var self = this;
  2470. var $1;
  2471. $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", [])])]);
  2472. return $1;
  2473. }
  2474. }),
  2475. smalltalk.Point);
  2476. smalltalk.addMethod(
  2477. "__plus",
  2478. smalltalk.method({
  2479. selector: "+",
  2480. fn: function (aPoint) {
  2481. var self = this;
  2482. var $1;
  2483. $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", [])])]);
  2484. return $1;
  2485. }
  2486. }),
  2487. smalltalk.Point);
  2488. smalltalk.addMethod(
  2489. "__minus",
  2490. smalltalk.method({
  2491. selector: "-",
  2492. fn: function (aPoint) {
  2493. var self = this;
  2494. var $1;
  2495. $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", [])])]);
  2496. return $1;
  2497. }
  2498. }),
  2499. smalltalk.Point);
  2500. smalltalk.addMethod(
  2501. "__slash",
  2502. smalltalk.method({
  2503. selector: "/",
  2504. fn: function (aPoint) {
  2505. var self = this;
  2506. var $1;
  2507. $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", [])])]);
  2508. return $1;
  2509. }
  2510. }),
  2511. smalltalk.Point);
  2512. smalltalk.addMethod(
  2513. "__eq",
  2514. smalltalk.method({
  2515. selector: "=",
  2516. fn: function (aPoint) {
  2517. var self = this;
  2518. var $1;
  2519. $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", [])])]);}]);
  2520. return $1;
  2521. }
  2522. }),
  2523. smalltalk.Point);
  2524. smalltalk.addMethod(
  2525. "_asPoint",
  2526. smalltalk.method({
  2527. selector: "asPoint",
  2528. fn: function () {
  2529. var self = this;
  2530. return self;
  2531. }
  2532. }),
  2533. smalltalk.Point);
  2534. smalltalk.addMethod(
  2535. "_printString",
  2536. smalltalk.method({
  2537. selector: "printString",
  2538. fn: function () {
  2539. var self = this;
  2540. var $2, $1;
  2541. $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", [])]);}]);
  2542. return $1;
  2543. }
  2544. }),
  2545. smalltalk.Point);
  2546. smalltalk.addMethod(
  2547. "_translateBy_",
  2548. smalltalk.method({
  2549. selector: "translateBy:",
  2550. fn: function (delta) {
  2551. var self = this;
  2552. var $1;
  2553. $1 = smalltalk.send(smalltalk.send(smalltalk.send(delta, "_x", []), "__plus", [self['@x']]), "__at", [smalltalk.send(smalltalk.send(delta, "_y", []), "__plus", [self['@y']])]);
  2554. return $1;
  2555. }
  2556. }),
  2557. smalltalk.Point);
  2558. smalltalk.addMethod(
  2559. "_x",
  2560. smalltalk.method({
  2561. selector: "x",
  2562. fn: function () {
  2563. var self = this;
  2564. return self['@x'];
  2565. }
  2566. }),
  2567. smalltalk.Point);
  2568. smalltalk.addMethod(
  2569. "_x_",
  2570. smalltalk.method({
  2571. selector: "x:",
  2572. fn: function (aNumber) {
  2573. var self = this;
  2574. self['@x'] = aNumber;
  2575. return self;
  2576. }
  2577. }),
  2578. smalltalk.Point);
  2579. smalltalk.addMethod(
  2580. "_y",
  2581. smalltalk.method({
  2582. selector: "y",
  2583. fn: function () {
  2584. var self = this;
  2585. return self['@y'];
  2586. }
  2587. }),
  2588. smalltalk.Point);
  2589. smalltalk.addMethod(
  2590. "_y_",
  2591. smalltalk.method({
  2592. selector: "y:",
  2593. fn: function (aNumber) {
  2594. var self = this;
  2595. self['@y'] = aNumber;
  2596. return self;
  2597. }
  2598. }),
  2599. smalltalk.Point);
  2600. smalltalk.addMethod(
  2601. "_x_y_",
  2602. smalltalk.method({
  2603. selector: "x:y:",
  2604. fn: function (aNumber, anotherNumber) {
  2605. var self = this;
  2606. var $2, $3, $1;
  2607. $2 = smalltalk.send(self, "_new", []);
  2608. smalltalk.send($2, "_x_", [aNumber]);
  2609. smalltalk.send($2, "_y_", [anotherNumber]);
  2610. $3 = smalltalk.send($2, "_yourself", []);
  2611. $1 = $3;
  2612. return $1;
  2613. }
  2614. }),
  2615. smalltalk.Point.klass);
  2616. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  2617. smalltalk.addMethod(
  2618. "_next",
  2619. smalltalk.method({
  2620. selector: "next",
  2621. fn: function () {
  2622. var self = this;
  2623. return Math.random();
  2624. return self;
  2625. }
  2626. }),
  2627. smalltalk.Random);
  2628. smalltalk.addMethod(
  2629. "_next_",
  2630. smalltalk.method({
  2631. selector: "next:",
  2632. fn: function (anInteger) {
  2633. var self = this;
  2634. var $1;
  2635. $1 = smalltalk.send(smalltalk.send(1, "_to_", [anInteger]), "_collect_", [function (each) {return smalltalk.send(self, "_next", []);}]);
  2636. return $1;
  2637. }
  2638. }),
  2639. smalltalk.Random);
  2640. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
  2641. smalltalk.addMethod(
  2642. "_at_",
  2643. smalltalk.method({
  2644. selector: "at:",
  2645. fn: function (aSymbol) {
  2646. var self = this;
  2647. return self[aSymbol._asString()];
  2648. return self;
  2649. }
  2650. }),
  2651. smalltalk.Smalltalk);
  2652. smalltalk.addMethod(
  2653. "_basicParse_",
  2654. smalltalk.method({
  2655. selector: "basicParse:",
  2656. fn: function (aString) {
  2657. var self = this;
  2658. return smalltalk.parser.parse(aString);
  2659. return self;
  2660. }
  2661. }),
  2662. smalltalk.Smalltalk);
  2663. smalltalk.addMethod(
  2664. "_classes",
  2665. smalltalk.method({
  2666. selector: "classes",
  2667. fn: function () {
  2668. var self = this;
  2669. return self.classes();
  2670. return self;
  2671. }
  2672. }),
  2673. smalltalk.Smalltalk);
  2674. smalltalk.addMethod(
  2675. "_createPackage_",
  2676. smalltalk.method({
  2677. selector: "createPackage:",
  2678. fn: function (packageName) {
  2679. var self = this;
  2680. return smalltalk.addPackage(packageName, nil);
  2681. return self;
  2682. }
  2683. }),
  2684. smalltalk.Smalltalk);
  2685. smalltalk.addMethod(
  2686. "_createPackage_properties_",
  2687. smalltalk.method({
  2688. selector: "createPackage:properties:",
  2689. fn: function (packageName, aDict) {
  2690. var self = this;
  2691. var object;
  2692. object = {};
  2693. smalltalk.send(aDict, "_keysAndValuesDo_", [function (key, value) {return object[key] = value;}]);
  2694. return smalltalk.addPackage(packageName, object);
  2695. return self;
  2696. }
  2697. }),
  2698. smalltalk.Smalltalk);
  2699. smalltalk.addMethod(
  2700. "_deleteClass_",
  2701. smalltalk.method({
  2702. selector: "deleteClass:",
  2703. fn: function (aClass) {
  2704. var self = this;
  2705. self.removeClass(aClass);
  2706. return self;
  2707. }
  2708. }),
  2709. smalltalk.Smalltalk);
  2710. smalltalk.addMethod(
  2711. "_deletePackage_",
  2712. smalltalk.method({
  2713. selector: "deletePackage:",
  2714. fn: function (packageName) {
  2715. var self = this;
  2716. delete smalltalk.packages[packageName];
  2717. return self;
  2718. }
  2719. }),
  2720. smalltalk.Smalltalk);
  2721. smalltalk.addMethod(
  2722. "_packageAt_",
  2723. smalltalk.method({
  2724. selector: "packageAt:",
  2725. fn: function (packageName) {
  2726. var self = this;
  2727. return self.packages[packageName];
  2728. return self;
  2729. }
  2730. }),
  2731. smalltalk.Smalltalk);
  2732. smalltalk.addMethod(
  2733. "_packageAt_ifAbsent_",
  2734. smalltalk.method({
  2735. selector: "packageAt:ifAbsent:",
  2736. fn: function (packageName, aBlock) {
  2737. var self = this;
  2738. var $2, $1;
  2739. $2 = smalltalk.send(self, "_packageAt_", [packageName]);
  2740. $1 = smalltalk.send($2, "_ifNil_", [aBlock]);
  2741. return $1;
  2742. }
  2743. }),
  2744. smalltalk.Smalltalk);
  2745. smalltalk.addMethod(
  2746. "_packages",
  2747. smalltalk.method({
  2748. selector: "packages",
  2749. fn: function () {
  2750. var self = this;
  2751. return self.packages.all();
  2752. return self;
  2753. }
  2754. }),
  2755. smalltalk.Smalltalk);
  2756. smalltalk.addMethod(
  2757. "_parse_",
  2758. smalltalk.method({
  2759. selector: "parse:",
  2760. fn: function (aString) {
  2761. var self = this;
  2762. var result;
  2763. 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", []);}]);
  2764. return result;
  2765. }
  2766. }),
  2767. smalltalk.Smalltalk);
  2768. smalltalk.addMethod(
  2769. "_parseError_parsing_",
  2770. smalltalk.method({
  2771. selector: "parseError:parsing:",
  2772. fn: function (anException, aString) {
  2773. var self = this;
  2774. var $1;
  2775. var row;
  2776. var col;
  2777. var message;
  2778. var lines;
  2779. var badLine;
  2780. var code;
  2781. row = anException.line;
  2782. col = anException.column;
  2783. message = anException.message;
  2784. lines = smalltalk.send(aString, "_lines", []);
  2785. badLine = smalltalk.send(lines, "_at_", [row]);
  2786. 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", [])])]);
  2787. smalltalk.send(lines, "_at_put_", [row, badLine]);
  2788. 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", [])])]);}]);}]);
  2789. $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])]);
  2790. return $1;
  2791. }
  2792. }),
  2793. smalltalk.Smalltalk);
  2794. smalltalk.addMethod(
  2795. "_pseudoVariableNames",
  2796. smalltalk.method({
  2797. selector: "pseudoVariableNames",
  2798. fn: function () {
  2799. var self = this;
  2800. return ["self", "super", "nil", "true", "false", "thisContext"];
  2801. }
  2802. }),
  2803. smalltalk.Smalltalk);
  2804. smalltalk.addMethod(
  2805. "_readJSObject_",
  2806. smalltalk.method({
  2807. selector: "readJSObject:",
  2808. fn: function (anObject) {
  2809. var self = this;
  2810. return self.readJSObject(anObject);
  2811. return self;
  2812. }
  2813. }),
  2814. smalltalk.Smalltalk);
  2815. smalltalk.addMethod(
  2816. "_removeClass_",
  2817. smalltalk.method({
  2818. selector: "removeClass:",
  2819. fn: function (aClass) {
  2820. var self = this;
  2821. var $1, $2, $3;
  2822. $1 = smalltalk.send(aClass, "_isMetaclass", []);
  2823. if (smalltalk.assert($1)) {
  2824. smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [" is a Metaclass and cannot be removed!"])]);
  2825. }
  2826. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);}]);
  2827. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);}]);
  2828. smalltalk.send(self, "_deleteClass_", [aClass]);
  2829. $2 = smalltalk.send(smalltalk.ClassRemoved || ClassRemoved, "_new", []);
  2830. smalltalk.send($2, "_theClass_", [aClass]);
  2831. $3 = smalltalk.send($2, "_yourself", []);
  2832. smalltalk.send(smalltalk.send(smalltalk.SystemAnnouncer || SystemAnnouncer, "_current", []), "_announce_", [$3]);
  2833. return self;
  2834. }
  2835. }),
  2836. smalltalk.Smalltalk);
  2837. smalltalk.addMethod(
  2838. "_removePackage_",
  2839. smalltalk.method({
  2840. selector: "removePackage:",
  2841. fn: function (packageName) {
  2842. var self = this;
  2843. var pkg;
  2844. pkg = smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, function () {return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);}]);
  2845. smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [function (each) {return smalltalk.send(self, "_removeClass_", [each]);}]);
  2846. smalltalk.send(self, "_deletePackage_", [packageName]);
  2847. return self;
  2848. }
  2849. }),
  2850. smalltalk.Smalltalk);
  2851. smalltalk.addMethod(
  2852. "_renamePackage_to_",
  2853. smalltalk.method({
  2854. selector: "renamePackage:to:",
  2855. fn: function (packageName, newName) {
  2856. var self = this;
  2857. var $1;
  2858. var pkg;
  2859. pkg = smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, function () {return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);}]);
  2860. $1 = smalltalk.send(self, "_packageAt_", [newName]);
  2861. if (($receiver = $1) == nil || $receiver == undefined) {
  2862. } else {
  2863. smalltalk.send(self, "_error_", [smalltalk.send("Already exists a package called: ", "__comma", [newName])]);
  2864. }
  2865. smalltalk.packages[newName] = smalltalk.packages[packageName];
  2866. smalltalk.send(pkg, "_name_", [newName]);
  2867. smalltalk.send(self, "_deletePackage_", [packageName]);
  2868. return self;
  2869. }
  2870. }),
  2871. smalltalk.Smalltalk);
  2872. smalltalk.addMethod(
  2873. "_reservedWords",
  2874. smalltalk.method({
  2875. selector: "reservedWords",
  2876. fn: function () {
  2877. var self = this;
  2878. return self.reservedWords;
  2879. return self;
  2880. }
  2881. }),
  2882. smalltalk.Smalltalk);
  2883. smalltalk.addMethod(
  2884. "_send_to_arguments_",
  2885. smalltalk.method({
  2886. selector: "send:to:arguments:",
  2887. fn: function (aSelector, anObject, aCollection) {
  2888. var self = this;
  2889. var selector;
  2890. selector = smalltalk.send(smalltalk.send(aSelector, "_asString", []), "_asSelector", []);
  2891. return self.send(anObject, selector, aCollection);
  2892. return self;
  2893. }
  2894. }),
  2895. smalltalk.Smalltalk);
  2896. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  2897. smalltalk.addMethod(
  2898. "_current",
  2899. smalltalk.method({
  2900. selector: "current",
  2901. fn: function () {
  2902. var self = this;
  2903. return smalltalk;
  2904. return self;
  2905. }
  2906. }),
  2907. smalltalk.Smalltalk.klass);
  2908. smalltalk.addClass('Timeout', smalltalk.Object, ['rawTimeout'], 'Kernel-Objects');
  2909. smalltalk.addMethod(
  2910. "_clearInterval",
  2911. smalltalk.method({
  2912. selector: "clearInterval",
  2913. fn: function (){
  2914. var self=this;
  2915. var interval = self["@rawTimeout"];
  2916. clearInterval(interval);
  2917. ;
  2918. ;
  2919. return self}
  2920. }),
  2921. smalltalk.Timeout);
  2922. smalltalk.addMethod(
  2923. "_clearTimeout",
  2924. smalltalk.method({
  2925. selector: "clearTimeout",
  2926. fn: function (){
  2927. var self=this;
  2928. var timeout = self["@rawTimeout"];
  2929. clearTimeout(timeout);
  2930. ;
  2931. ;
  2932. return self}
  2933. }),
  2934. smalltalk.Timeout);
  2935. smalltalk.addMethod(
  2936. "_rawTimeout_",
  2937. smalltalk.method({
  2938. selector: "rawTimeout:",
  2939. fn: function (anObject){
  2940. var self=this;
  2941. self["@rawTimeout"]=anObject;
  2942. return self}
  2943. }),
  2944. smalltalk.Timeout);
  2945. smalltalk.addMethod(
  2946. "_on_",
  2947. smalltalk.method({
  2948. selector: "on:",
  2949. fn: function (anObject){
  2950. var self=this;
  2951. var $2,$3,$1;
  2952. $2=smalltalk.send(self,"_new",[]);
  2953. smalltalk.send($2,"_rawTimeout_",[anObject]);
  2954. $3=smalltalk.send($2,"_yourself",[]);
  2955. $1=$3;
  2956. return $1;
  2957. }
  2958. }),
  2959. smalltalk.Timeout.klass);
  2960. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  2961. smalltalk.addMethod(
  2962. "_asJSON",
  2963. smalltalk.method({
  2964. selector: "asJSON",
  2965. fn: function () {
  2966. var self = this;
  2967. return null;
  2968. }
  2969. }),
  2970. smalltalk.UndefinedObject);
  2971. smalltalk.addMethod(
  2972. "_deepCopy",
  2973. smalltalk.method({
  2974. selector: "deepCopy",
  2975. fn: function () {
  2976. var self = this;
  2977. return self;
  2978. }
  2979. }),
  2980. smalltalk.UndefinedObject);
  2981. smalltalk.addMethod(
  2982. "_ifNil_",
  2983. smalltalk.method({
  2984. selector: "ifNil:",
  2985. fn: function (aBlock) {
  2986. var self = this;
  2987. var $1;
  2988. $1 = smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, function () {}]);
  2989. return $1;
  2990. }
  2991. }),
  2992. smalltalk.UndefinedObject);
  2993. smalltalk.addMethod(
  2994. "_ifNil_ifNotNil_",
  2995. smalltalk.method({
  2996. selector: "ifNil:ifNotNil:",
  2997. fn: function (aBlock, anotherBlock) {
  2998. var self = this;
  2999. var $1;
  3000. $1 = smalltalk.send(aBlock, "_value", []);
  3001. return $1;
  3002. }
  3003. }),
  3004. smalltalk.UndefinedObject);
  3005. smalltalk.addMethod(
  3006. "_ifNotNil_",
  3007. smalltalk.method({
  3008. selector: "ifNotNil:",
  3009. fn: function (aBlock) {
  3010. var self = this;
  3011. return self;
  3012. }
  3013. }),
  3014. smalltalk.UndefinedObject);
  3015. smalltalk.addMethod(
  3016. "_ifNotNil_ifNil_",
  3017. smalltalk.method({
  3018. selector: "ifNotNil:ifNil:",
  3019. fn: function (aBlock, anotherBlock) {
  3020. var self = this;
  3021. var $1;
  3022. $1 = smalltalk.send(anotherBlock, "_value", []);
  3023. return $1;
  3024. }
  3025. }),
  3026. smalltalk.UndefinedObject);
  3027. smalltalk.addMethod(
  3028. "_isNil",
  3029. smalltalk.method({
  3030. selector: "isNil",
  3031. fn: function () {
  3032. var self = this;
  3033. return true;
  3034. }
  3035. }),
  3036. smalltalk.UndefinedObject);
  3037. smalltalk.addMethod(
  3038. "_notNil",
  3039. smalltalk.method({
  3040. selector: "notNil",
  3041. fn: function () {
  3042. var self = this;
  3043. return false;
  3044. }
  3045. }),
  3046. smalltalk.UndefinedObject);
  3047. smalltalk.addMethod(
  3048. "_printString",
  3049. smalltalk.method({
  3050. selector: "printString",
  3051. fn: function () {
  3052. var self = this;
  3053. return "nil";
  3054. }
  3055. }),
  3056. smalltalk.UndefinedObject);
  3057. smalltalk.addMethod(
  3058. "_shallowCopy",
  3059. smalltalk.method({
  3060. selector: "shallowCopy",
  3061. fn: function () {
  3062. var self = this;
  3063. return self;
  3064. }
  3065. }),
  3066. smalltalk.UndefinedObject);
  3067. smalltalk.addMethod(
  3068. "_subclass_instanceVariableNames_",
  3069. smalltalk.method({
  3070. selector: "subclass:instanceVariableNames:",
  3071. fn: function (aString, anotherString) {
  3072. var self = this;
  3073. var $1;
  3074. $1 = smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  3075. return $1;
  3076. }
  3077. }),
  3078. smalltalk.UndefinedObject);
  3079. smalltalk.addMethod(
  3080. "_subclass_instanceVariableNames_category_",
  3081. smalltalk.method({
  3082. selector: "subclass:instanceVariableNames:category:",
  3083. fn: function (aString, aString2, aString3) {
  3084. var self = this;
  3085. var $1;
  3086. smalltalk.send(self, "_deprecatedAPI", []);
  3087. $1 = smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  3088. return $1;
  3089. }
  3090. }),
  3091. smalltalk.UndefinedObject);
  3092. smalltalk.addMethod(
  3093. "_subclass_instanceVariableNames_package_",
  3094. smalltalk.method({
  3095. selector: "subclass:instanceVariableNames:package:",
  3096. fn: function (aString, aString2, aString3) {
  3097. var self = this;
  3098. var $1;
  3099. $1 = smalltalk.send(smalltalk.send(smalltalk.ClassBuilder || ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  3100. return $1;
  3101. }
  3102. }),
  3103. smalltalk.UndefinedObject);
  3104. smalltalk.addMethod(
  3105. "_new",
  3106. smalltalk.method({
  3107. selector: "new",
  3108. fn: function () {
  3109. var self = this;
  3110. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  3111. return self;
  3112. }
  3113. }),
  3114. smalltalk.UndefinedObject.klass);