2
0

Kernel-Objects.deploy.js 69 KB

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