1
0

Kernel-Objects.deploy.js 78 KB

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