Kernel-Objects.deploy.js 68 KB

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