1
0

Kernel-Objects.deploy.js 86 KB

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