Kernel-Objects.deploy.js 70 KB

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