2
0

Kernel-Objects.deploy.js 73 KB

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