Kernel-Objects.deploy.js 68 KB

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