Kernel-Objects.deploy.js 67 KB

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