Trapped-Backend.deploy.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. smalltalk.addPackage('Trapped-Backend');
  2. smalltalk.addClass('EavModel', smalltalk.Object, ['getBlock', 'putBlock'], 'Trapped-Backend');
  3. smalltalk.addMethod(
  4. "_getBlock_",
  5. smalltalk.method({
  6. selector: "getBlock:",
  7. fn: function (aBlock){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) { self["@getBlock"]=aBlock;
  10. return self}, function($ctx1) {$ctx1.fill(self,"getBlock:",{aBlock:aBlock},smalltalk.EavModel)})},
  11. messageSends: []}),
  12. smalltalk.EavModel);
  13. smalltalk.addMethod(
  14. "_initialize",
  15. smalltalk.method({
  16. selector: "initialize",
  17. fn: function (){
  18. var self=this;
  19. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  20. self["@getBlock"]=(function(){
  21. return smalltalk.withContext(function($ctx2) { return _st(self)._error_("No getter block.");
  22. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  23. self["@putBlock"]=(function(){
  24. return smalltalk.withContext(function($ctx2) { return _st(self)._error_("No putter block.");
  25. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  26. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.EavModel)})},
  27. messageSends: ["initialize", "error:"]}),
  28. smalltalk.EavModel);
  29. smalltalk.addMethod(
  30. "_on_",
  31. smalltalk.method({
  32. selector: "on:",
  33. fn: function (anObject){
  34. var self=this;
  35. return smalltalk.withContext(function($ctx1) { var $1;
  36. $1=_st(self["@getBlock"])._value_(anObject);
  37. return $1;
  38. }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.EavModel)})},
  39. messageSends: ["value:"]}),
  40. smalltalk.EavModel);
  41. smalltalk.addMethod(
  42. "_on_put_",
  43. smalltalk.method({
  44. selector: "on:put:",
  45. fn: function (anObject,anObject2){
  46. var self=this;
  47. return smalltalk.withContext(function($ctx1) { var $1;
  48. $1=_st(self["@putBlock"])._value_value_(anObject,anObject2);
  49. return $1;
  50. }, function($ctx1) {$ctx1.fill(self,"on:put:",{anObject:anObject,anObject2:anObject2},smalltalk.EavModel)})},
  51. messageSends: ["value:value:"]}),
  52. smalltalk.EavModel);
  53. smalltalk.addMethod(
  54. "_putBlock_",
  55. smalltalk.method({
  56. selector: "putBlock:",
  57. fn: function (aBlock){
  58. var self=this;
  59. return smalltalk.withContext(function($ctx1) { self["@putBlock"]=aBlock;
  60. return self}, function($ctx1) {$ctx1.fill(self,"putBlock:",{aBlock:aBlock},smalltalk.EavModel)})},
  61. messageSends: []}),
  62. smalltalk.EavModel);
  63. smalltalk.addClass('Isolator', smalltalk.Object, ['root'], 'Trapped-Backend');
  64. smalltalk.addMethod(
  65. "_model_modify_",
  66. smalltalk.method({
  67. selector: "model:modify:",
  68. fn: function (anEavModel,aBlock){
  69. var self=this;
  70. var newValue;
  71. return smalltalk.withContext(function($ctx1) { newValue=_st(aBlock)._value_(_st(anEavModel)._on_(self));
  72. _st(anEavModel)._on_put_(self,_st(newValue)._deepCopy());
  73. return self}, function($ctx1) {$ctx1.fill(self,"model:modify:",{anEavModel:anEavModel,aBlock:aBlock,newValue:newValue},smalltalk.Isolator)})},
  74. messageSends: ["value:", "on:", "on:put:", "deepCopy"]}),
  75. smalltalk.Isolator);
  76. smalltalk.addMethod(
  77. "_model_read_",
  78. smalltalk.method({
  79. selector: "model:read:",
  80. fn: function (anEavModel,aBlock){
  81. var self=this;
  82. return smalltalk.withContext(function($ctx1) { _st(aBlock)._value_(_st(_st(anEavModel)._on_(self))._deepCopy());
  83. return self}, function($ctx1) {$ctx1.fill(self,"model:read:",{anEavModel:anEavModel,aBlock:aBlock},smalltalk.Isolator)})},
  84. messageSends: ["value:", "deepCopy", "on:"]}),
  85. smalltalk.Isolator);
  86. smalltalk.addMethod(
  87. "_root",
  88. smalltalk.method({
  89. selector: "root",
  90. fn: function (){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx1) { var $1;
  93. $1=self["@root"];
  94. return $1;
  95. }, function($ctx1) {$ctx1.fill(self,"root",{},smalltalk.Isolator)})},
  96. messageSends: []}),
  97. smalltalk.Isolator);
  98. smalltalk.addMethod(
  99. "_root_",
  100. smalltalk.method({
  101. selector: "root:",
  102. fn: function (anObject){
  103. var self=this;
  104. return smalltalk.withContext(function($ctx1) { self["@root"]=anObject;
  105. return self}, function($ctx1) {$ctx1.fill(self,"root:",{anObject:anObject},smalltalk.Isolator)})},
  106. messageSends: []}),
  107. smalltalk.Isolator);
  108. smalltalk.addMethod(
  109. "_on_",
  110. smalltalk.method({
  111. selector: "on:",
  112. fn: function (anObject){
  113. var self=this;
  114. return smalltalk.withContext(function($ctx1) { var $1;
  115. $1=_st(_st(self)._new())._root_(anObject);
  116. return $1;
  117. }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Isolator.klass)})},
  118. messageSends: ["root:", "new"]}),
  119. smalltalk.Isolator.klass);
  120. smalltalk.addClass('KeyedPubSubBase', smalltalk.Object, ['factory'], 'Trapped-Backend');
  121. smalltalk.addMethod(
  122. "_changed_",
  123. smalltalk.method({
  124. selector: "changed:",
  125. fn: function (key){
  126. var self=this;
  127. var needsToRun;
  128. return smalltalk.withContext(function($ctx1) { var $1;
  129. needsToRun=false;
  130. _st(self)._do_((function(each){
  131. return smalltalk.withContext(function($ctx2) { $1=_st(each)._accepts_(key);
  132. if(smalltalk.assert($1)){
  133. _st(each)._flag();
  134. needsToRun=true;
  135. return needsToRun;
  136. };
  137. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  138. _st(self)._dirty_(needsToRun);
  139. return self}, function($ctx1) {$ctx1.fill(self,"changed:",{key:key,needsToRun:needsToRun},smalltalk.KeyedPubSubBase)})},
  140. messageSends: ["do:", "ifTrue:", "flag", "accepts:", "dirty:"]}),
  141. smalltalk.KeyedPubSubBase);
  142. smalltalk.addMethod(
  143. "_dirty_",
  144. smalltalk.method({
  145. selector: "dirty:",
  146. fn: function (aBoolean){
  147. var self=this;
  148. return smalltalk.withContext(function($ctx1) { var $1;
  149. $1=aBoolean;
  150. if(smalltalk.assert($1)){
  151. _st((function(){
  152. return smalltalk.withContext(function($ctx2) { return _st(self)._run();
  153. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._fork();
  154. };
  155. return self}, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean},smalltalk.KeyedPubSubBase)})},
  156. messageSends: ["ifTrue:", "fork", "run"]}),
  157. smalltalk.KeyedPubSubBase);
  158. smalltalk.addMethod(
  159. "_on_hook_",
  160. smalltalk.method({
  161. selector: "on:hook:",
  162. fn: function (key,aBlock){
  163. var self=this;
  164. return smalltalk.withContext(function($ctx1) { _st(self)._add_(_st(_st(self["@factory"])._value_value_(key,aBlock))._flag());
  165. _st(self)._dirty_(true);
  166. return self}, function($ctx1) {$ctx1.fill(self,"on:hook:",{key:key,aBlock:aBlock},smalltalk.KeyedPubSubBase)})},
  167. messageSends: ["add:", "flag", "value:value:", "dirty:"]}),
  168. smalltalk.KeyedPubSubBase);
  169. smalltalk.addMethod(
  170. "_run",
  171. smalltalk.method({
  172. selector: "run",
  173. fn: function (){
  174. var self=this;
  175. var needsClean;
  176. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  177. needsClean=false;
  178. _st(self)._do_((function(each){
  179. return smalltalk.withContext(function($ctx2) { $1=_st(each)._isFlagged();
  180. if(smalltalk.assert($1)){
  181. _st(each)._run();
  182. $2=_st(each)._isEnabled();
  183. if(! smalltalk.assert($2)){
  184. needsClean=true;
  185. return needsClean;
  186. };
  187. };
  188. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  189. $3=needsClean;
  190. if(smalltalk.assert($3)){
  191. _st(self)._clean();
  192. };
  193. return self}, function($ctx1) {$ctx1.fill(self,"run",{needsClean:needsClean},smalltalk.KeyedPubSubBase)})},
  194. messageSends: ["do:", "ifTrue:", "run", "ifFalse:", "isEnabled", "isFlagged", "clean"]}),
  195. smalltalk.KeyedPubSubBase);
  196. smalltalk.addMethod(
  197. "_subscriptionFactory_",
  198. smalltalk.method({
  199. selector: "subscriptionFactory:",
  200. fn: function (aBlock){
  201. var self=this;
  202. return smalltalk.withContext(function($ctx1) { self["@factory"]=aBlock;
  203. return self}, function($ctx1) {$ctx1.fill(self,"subscriptionFactory:",{aBlock:aBlock},smalltalk.KeyedPubSubBase)})},
  204. messageSends: []}),
  205. smalltalk.KeyedPubSubBase);
  206. smalltalk.addClass('SimpleKeyedPubSub', smalltalk.KeyedPubSubBase, ['queue'], 'Trapped-Backend');
  207. smalltalk.addMethod(
  208. "_add_",
  209. smalltalk.method({
  210. selector: "add:",
  211. fn: function (aSubscription){
  212. var self=this;
  213. return smalltalk.withContext(function($ctx1) { _st(self["@queue"])._add_(aSubscription);
  214. return self}, function($ctx1) {$ctx1.fill(self,"add:",{aSubscription:aSubscription},smalltalk.SimpleKeyedPubSub)})},
  215. messageSends: ["add:"]}),
  216. smalltalk.SimpleKeyedPubSub);
  217. smalltalk.addMethod(
  218. "_clean",
  219. smalltalk.method({
  220. selector: "clean",
  221. fn: function (){
  222. var self=this;
  223. return smalltalk.withContext(function($ctx1) { self["@queue"]=_st(self["@queue"])._select_((function(each){
  224. return smalltalk.withContext(function($ctx2) { return _st(each)._isEnabled();
  225. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  226. return self}, function($ctx1) {$ctx1.fill(self,"clean",{},smalltalk.SimpleKeyedPubSub)})},
  227. messageSends: ["select:", "isEnabled"]}),
  228. smalltalk.SimpleKeyedPubSub);
  229. smalltalk.addMethod(
  230. "_do_",
  231. smalltalk.method({
  232. selector: "do:",
  233. fn: function (aBlock){
  234. var self=this;
  235. return smalltalk.withContext(function($ctx1) { _st(self["@queue"])._do_(aBlock);
  236. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.SimpleKeyedPubSub)})},
  237. messageSends: ["do:"]}),
  238. smalltalk.SimpleKeyedPubSub);
  239. smalltalk.addMethod(
  240. "_initialize",
  241. smalltalk.method({
  242. selector: "initialize",
  243. fn: function (){
  244. var self=this;
  245. return smalltalk.withContext(function($ctx1) { smalltalk.KeyedPubSubBase.fn.prototype._initialize.apply(_st(self), []);
  246. self["@queue"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  247. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.SimpleKeyedPubSub)})},
  248. messageSends: ["initialize", "new"]}),
  249. smalltalk.SimpleKeyedPubSub);
  250. smalltalk.addClass('KeyedPubSubUnsubscribe', smalltalk.Error, [], 'Trapped-Backend');
  251. smalltalk.addClass('KeyedSubscriptionBase', smalltalk.Object, ['key', 'actionBlock', 'flagged'], 'Trapped-Backend');
  252. smalltalk.addMethod(
  253. "_accepts_",
  254. smalltalk.method({
  255. selector: "accepts:",
  256. fn: function (aKey){
  257. var self=this;
  258. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  259. return self}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},smalltalk.KeyedSubscriptionBase)})},
  260. messageSends: ["subclassResponsibility"]}),
  261. smalltalk.KeyedSubscriptionBase);
  262. smalltalk.addMethod(
  263. "_flag",
  264. smalltalk.method({
  265. selector: "flag",
  266. fn: function (){
  267. var self=this;
  268. return smalltalk.withContext(function($ctx1) { self["@flagged"]=true;
  269. return self}, function($ctx1) {$ctx1.fill(self,"flag",{},smalltalk.KeyedSubscriptionBase)})},
  270. messageSends: []}),
  271. smalltalk.KeyedSubscriptionBase);
  272. smalltalk.addMethod(
  273. "_initialize",
  274. smalltalk.method({
  275. selector: "initialize",
  276. fn: function (){
  277. var self=this;
  278. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  279. self["@key"]=nil;
  280. self["@actionBlock"]=nil;
  281. self["@flagged"]=false;
  282. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.KeyedSubscriptionBase)})},
  283. messageSends: ["initialize"]}),
  284. smalltalk.KeyedSubscriptionBase);
  285. smalltalk.addMethod(
  286. "_isEnabled",
  287. smalltalk.method({
  288. selector: "isEnabled",
  289. fn: function (){
  290. var self=this;
  291. return smalltalk.withContext(function($ctx1) { var $1;
  292. $1=_st(self["@actionBlock"])._notNil();
  293. return $1;
  294. }, function($ctx1) {$ctx1.fill(self,"isEnabled",{},smalltalk.KeyedSubscriptionBase)})},
  295. messageSends: ["notNil"]}),
  296. smalltalk.KeyedSubscriptionBase);
  297. smalltalk.addMethod(
  298. "_isFlagged",
  299. smalltalk.method({
  300. selector: "isFlagged",
  301. fn: function (){
  302. var self=this;
  303. return smalltalk.withContext(function($ctx1) { var $1;
  304. $1=self["@flagged"];
  305. return $1;
  306. }, function($ctx1) {$ctx1.fill(self,"isFlagged",{},smalltalk.KeyedSubscriptionBase)})},
  307. messageSends: []}),
  308. smalltalk.KeyedSubscriptionBase);
  309. smalltalk.addMethod(
  310. "_key_block_",
  311. smalltalk.method({
  312. selector: "key:block:",
  313. fn: function (anObject,aBlock){
  314. var self=this;
  315. return smalltalk.withContext(function($ctx1) { self["@key"]=anObject;
  316. self["@actionBlock"]=aBlock;
  317. return self}, function($ctx1) {$ctx1.fill(self,"key:block:",{anObject:anObject,aBlock:aBlock},smalltalk.KeyedSubscriptionBase)})},
  318. messageSends: []}),
  319. smalltalk.KeyedSubscriptionBase);
  320. smalltalk.addMethod(
  321. "_run",
  322. smalltalk.method({
  323. selector: "run",
  324. fn: function (){
  325. var self=this;
  326. return smalltalk.withContext(function($ctx1) { _st((function(){
  327. return smalltalk.withContext(function($ctx2) { return _st((function(){
  328. return smalltalk.withContext(function($ctx3) { return _st(self["@actionBlock"])._value();
  329. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._ensure_((function(){
  330. return smalltalk.withContext(function($ctx3) { self["@flagged"]=false;
  331. return self["@flagged"];
  332. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  333. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.KeyedPubSubUnsubscribe || KeyedPubSubUnsubscribe),(function(){
  334. return smalltalk.withContext(function($ctx2) { self["@actionBlock"]=nil;
  335. return self["@actionBlock"];
  336. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  337. return self}, function($ctx1) {$ctx1.fill(self,"run",{},smalltalk.KeyedSubscriptionBase)})},
  338. messageSends: ["on:do:", "ensure:", "value"]}),
  339. smalltalk.KeyedSubscriptionBase);
  340. smalltalk.addClass('ListKeyedSubscription', smalltalk.KeyedSubscriptionBase, [], 'Trapped-Backend');
  341. smalltalk.addMethod(
  342. "_accepts_",
  343. smalltalk.method({
  344. selector: "accepts:",
  345. fn: function (aKey){
  346. var self=this;
  347. return smalltalk.withContext(function($ctx1) { var $1;
  348. $1=_st(_st(_st(aKey)._size()).__lt_eq(_st(self["@key"])._size()))._and_((function(){
  349. return smalltalk.withContext(function($ctx2) { return _st(aKey).__eq(_st(self["@key"])._copyFrom_to_((1),_st(aKey)._size()));
  350. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  351. return $1;
  352. }, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},smalltalk.ListKeyedSubscription)})},
  353. messageSends: ["and:", "=", "copyFrom:to:", "size", "<="]}),
  354. smalltalk.ListKeyedSubscription);
  355. smalltalk.addClass('ListKeyedEntity', smalltalk.Object, ['dispatcher', 'payload'], 'Trapped-Backend');
  356. smalltalk.addMethod(
  357. "_dispatcher",
  358. smalltalk.method({
  359. selector: "dispatcher",
  360. fn: function (){
  361. var self=this;
  362. return smalltalk.withContext(function($ctx1) { var $1;
  363. $1=self["@dispatcher"];
  364. return $1;
  365. }, function($ctx1) {$ctx1.fill(self,"dispatcher",{},smalltalk.ListKeyedEntity)})},
  366. messageSends: []}),
  367. smalltalk.ListKeyedEntity);
  368. smalltalk.addMethod(
  369. "_dispatcher_",
  370. smalltalk.method({
  371. selector: "dispatcher:",
  372. fn: function (aDispatcher){
  373. var self=this;
  374. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  375. $1=aDispatcher;
  376. _st($1)._subscriptionFactory_((function(key,block){
  377. return smalltalk.withContext(function($ctx2) { $2=_st((smalltalk.ListKeyedSubscription || ListKeyedSubscription))._new();
  378. _st($2)._key_block_(key,block);
  379. $3=_st($2)._yourself();
  380. return $3;
  381. }, function($ctx2) {$ctx2.fillBlock({key:key,block:block},$ctx1)})}));
  382. $4=_st($1)._yourself();
  383. self["@dispatcher"]=$4;
  384. return self}, function($ctx1) {$ctx1.fill(self,"dispatcher:",{aDispatcher:aDispatcher},smalltalk.ListKeyedEntity)})},
  385. messageSends: ["subscriptionFactory:", "key:block:", "new", "yourself"]}),
  386. smalltalk.ListKeyedEntity);
  387. smalltalk.addMethod(
  388. "_model_",
  389. smalltalk.method({
  390. selector: "model:",
  391. fn: function (anObject){
  392. var self=this;
  393. return smalltalk.withContext(function($ctx1) { self["@payload"]=anObject;
  394. _st(_st(self)._dispatcher())._changed_([]);
  395. return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedEntity)})},
  396. messageSends: ["changed:", "dispatcher"]}),
  397. smalltalk.ListKeyedEntity);
  398. smalltalk.addMethod(
  399. "_watch_do_",
  400. smalltalk.method({
  401. selector: "watch:do:",
  402. fn: function (path,aBlock){
  403. var self=this;
  404. return smalltalk.withContext(function($ctx1) { _st(_st(self)._dispatcher())._on_hook_(path,(function(){
  405. return smalltalk.withContext(function($ctx2) { return _st(self)._read_do_(path,aBlock);
  406. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  407. return self}, function($ctx1) {$ctx1.fill(self,"watch:do:",{path:path,aBlock:aBlock},smalltalk.ListKeyedEntity)})},
  408. messageSends: ["on:hook:", "read:do:", "dispatcher"]}),
  409. smalltalk.ListKeyedEntity);
  410. smalltalk.addClass('ListKeyedDirectEntity', smalltalk.ListKeyedEntity, [], 'Trapped-Backend');
  411. smalltalk.addMethod(
  412. "_modify_do_",
  413. smalltalk.method({
  414. selector: "modify:do:",
  415. fn: function (path,aBlock){
  416. var self=this;
  417. var newValue,eavModel;
  418. return smalltalk.withContext(function($ctx1) { eavModel=_st(path)._asEavModel();
  419. newValue=_st(aBlock)._value_(_st(eavModel)._on_(self["@payload"]));
  420. _st((function(){
  421. return smalltalk.withContext(function($ctx2) { return _st(eavModel)._on_put_(self["@payload"],newValue);
  422. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
  423. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._dispatcher())._changed_(path);
  424. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  425. return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,newValue:newValue,eavModel:eavModel},smalltalk.ListKeyedDirectEntity)})},
  426. messageSends: ["asEavModel", "value:", "on:", "ensure:", "changed:", "dispatcher", "on:put:"]}),
  427. smalltalk.ListKeyedDirectEntity);
  428. smalltalk.addMethod(
  429. "_read_do_",
  430. smalltalk.method({
  431. selector: "read:do:",
  432. fn: function (path,aBlock){
  433. var self=this;
  434. var eavModel;
  435. return smalltalk.withContext(function($ctx1) { eavModel=_st(path)._asEavModel();
  436. _st(aBlock)._value_(_st(eavModel)._on_(self["@payload"]));
  437. return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedDirectEntity)})},
  438. messageSends: ["asEavModel", "value:", "on:"]}),
  439. smalltalk.ListKeyedDirectEntity);
  440. smalltalk.addClass('ListKeyedIsolatedEntity', smalltalk.ListKeyedEntity, [], 'Trapped-Backend');
  441. smalltalk.addMethod(
  442. "_model_",
  443. smalltalk.method({
  444. selector: "model:",
  445. fn: function (anObject){
  446. var self=this;
  447. return smalltalk.withContext(function($ctx1) { smalltalk.ListKeyedEntity.fn.prototype._model_.apply(_st(self), [_st((smalltalk.Isolator || Isolator))._on_(anObject)]);
  448. return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedIsolatedEntity)})},
  449. messageSends: ["model:", "on:"]}),
  450. smalltalk.ListKeyedIsolatedEntity);
  451. smalltalk.addMethod(
  452. "_modify_do_",
  453. smalltalk.method({
  454. selector: "modify:do:",
  455. fn: function (path,aBlock){
  456. var self=this;
  457. var eavModel;
  458. return smalltalk.withContext(function($ctx1) { eavModel=_st(_st([smalltalk.symbolFor("root")]).__comma(path))._asEavModel();
  459. _st((function(){
  460. return smalltalk.withContext(function($ctx2) { return _st(self["@payload"])._model_modify_(eavModel,aBlock);
  461. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
  462. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._dispatcher())._changed_(path);
  463. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  464. return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedIsolatedEntity)})},
  465. messageSends: ["asEavModel", ",", "ensure:", "changed:", "dispatcher", "model:modify:"]}),
  466. smalltalk.ListKeyedIsolatedEntity);
  467. smalltalk.addMethod(
  468. "_read_do_",
  469. smalltalk.method({
  470. selector: "read:do:",
  471. fn: function (path,aBlock){
  472. var self=this;
  473. var eavModel;
  474. return smalltalk.withContext(function($ctx1) { eavModel=_st(_st([smalltalk.symbolFor("root")]).__comma(path))._asEavModel();
  475. _st(self["@payload"])._model_read_(eavModel,aBlock);
  476. return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedIsolatedEntity)})},
  477. messageSends: ["asEavModel", ",", "model:read:"]}),
  478. smalltalk.ListKeyedIsolatedEntity);
  479. smalltalk.addMethod(
  480. "_reverseTrapAt_",
  481. smalltalk.method({
  482. selector: "reverseTrapAt:",
  483. fn: function (anObject){
  484. var self=this;
  485. return smalltalk.withContext(function($ctx1) { return nil;
  486. }, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.Object)})},
  487. messageSends: []}),
  488. smalltalk.Object);
  489. smalltalk.addMethod(
  490. "_reverseTrapAt_put_",
  491. smalltalk.method({
  492. selector: "reverseTrapAt:put:",
  493. fn: function (anObject,value){
  494. var self=this;
  495. return smalltalk.withContext(function($ctx1) { _st(self)._error_(_st(_st("Trapped cannot put at ").__comma(_st(_st(self)._class())._name())).__comma(" type key."));
  496. return self}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.Object)})},
  497. messageSends: ["error:", ",", "name", "class"]}),
  498. smalltalk.Object);
  499. smalltalk.addMethod(
  500. "_asEavModel",
  501. smalltalk.method({
  502. selector: "asEavModel",
  503. fn: function (){
  504. var self=this;
  505. var model;
  506. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$6,$5,$2,$7,$9,$11,$12,$14,$13,$10,$8,$15;
  507. model=_st((smalltalk.EavModel || EavModel))._new();
  508. $1=model;
  509. $2=(function(anObject){
  510. return smalltalk.withContext(function($ctx2) { $3=self;
  511. $4=anObject;
  512. $5=(function(soFar,segment){
  513. return smalltalk.withContext(function($ctx3) { $6=soFar;
  514. if(($receiver = $6) == nil || $receiver == undefined){
  515. return $6;
  516. } else {
  517. return _st(segment)._reverseTrapAt_(soFar);
  518. };
  519. }, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx1)})});
  520. return _st($3)._inject_into_($4,$5);
  521. }, function($ctx2) {$ctx2.fillBlock({anObject:anObject},$ctx1)})});
  522. _st($1)._getBlock_($2);
  523. $7=_st(self)._isEmpty();
  524. $8=(function(){
  525. return smalltalk.withContext(function($ctx2) { $9=model;
  526. $10=(function(anObject,value){
  527. var penultimate;
  528. return smalltalk.withContext(function($ctx3) { $11=_st(self)._allButLast();
  529. $12=anObject;
  530. $13=(function(soFar,segment){
  531. return smalltalk.withContext(function($ctx4) { $14=soFar;
  532. if(($receiver = $14) == nil || $receiver == undefined){
  533. return $14;
  534. } else {
  535. return _st(segment)._reverseTrapAt_(soFar);
  536. };
  537. }, function($ctx4) {$ctx4.fillBlock({soFar:soFar,segment:segment},$ctx1)})});
  538. penultimate=_st($11)._inject_into_($12,$13);
  539. penultimate;
  540. return _st(_st(self)._last())._reverseTrapAt_put_(penultimate,value);
  541. }, function($ctx3) {$ctx3.fillBlock({anObject:anObject,value:value,penultimate:penultimate},$ctx1)})});
  542. return _st($9)._putBlock_($10);
  543. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  544. _st($7)._ifFalse_($8);
  545. $15=model;
  546. return $15;
  547. }, function($ctx1) {$ctx1.fill(self,"asEavModel",{model:model}, smalltalk.SequenceableCollection)})},
  548. messageSends: ["new", "getBlock:", "inject:into:", "ifNotNil:", "reverseTrapAt:", "ifFalse:", "putBlock:", "allButLast", "reverseTrapAt:put:", "last", "isEmpty"]}),
  549. smalltalk.SequenceableCollection);
  550. smalltalk.addMethod(
  551. "_reverseTrapAt_",
  552. smalltalk.method({
  553. selector: "reverseTrapAt:",
  554. fn: function (anObject){
  555. var self=this;
  556. return smalltalk.withContext(function($ctx1) { var $1;
  557. $1=_st(anObject)._at_ifAbsent_(self,(function(){
  558. return smalltalk.withContext(function($ctx2) { return nil;
  559. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  560. return $1;
  561. }, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.String)})},
  562. messageSends: ["at:ifAbsent:"]}),
  563. smalltalk.String);
  564. smalltalk.addMethod(
  565. "_reverseTrapAt_put_",
  566. smalltalk.method({
  567. selector: "reverseTrapAt:put:",
  568. fn: function (anObject,value){
  569. var self=this;
  570. return smalltalk.withContext(function($ctx1) { var $1;
  571. $1=_st(anObject)._at_put_(self,value);
  572. return $1;
  573. }, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.String)})},
  574. messageSends: ["at:put:"]}),
  575. smalltalk.String);
  576. smalltalk.addMethod(
  577. "_reverseTrapAt_",
  578. smalltalk.method({
  579. selector: "reverseTrapAt:",
  580. fn: function (anObject){
  581. var self=this;
  582. return smalltalk.withContext(function($ctx1) { var $1;
  583. var $early={};
  584. try {
  585. $1=_st((function(){
  586. return smalltalk.withContext(function($ctx2) { return _st(anObject)._perform_(self);
  587. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.MessageNotUnderstood || MessageNotUnderstood),(function(){
  588. return smalltalk.withContext(function($ctx2) { throw $early=[nil];
  589. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  590. return $1;
  591. }
  592. catch(e) {if(e===$early)return e[0]; throw e}
  593. }, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.Symbol)})},
  594. messageSends: ["on:do:", "perform:"]}),
  595. smalltalk.Symbol);
  596. smalltalk.addMethod(
  597. "_reverseTrapAt_put_",
  598. smalltalk.method({
  599. selector: "reverseTrapAt:put:",
  600. fn: function (anObject,value){
  601. var self=this;
  602. return smalltalk.withContext(function($ctx1) { var $1;
  603. $1=_st(anObject)._perform_withArguments_(_st(_st(self).__comma(":"))._asSymbol(),[value]);
  604. return $1;
  605. }, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.Symbol)})},
  606. messageSends: ["perform:withArguments:", "asSymbol", ","]}),
  607. smalltalk.Symbol);
  608. smalltalk.addMethod(
  609. "_reverseTrapAt_",
  610. smalltalk.method({
  611. selector: "reverseTrapAt:",
  612. fn: function (anObject){
  613. var self=this;
  614. return smalltalk.withContext(function($ctx1) { var $1;
  615. $1=_st(anObject)._at_ifAbsent_(self,(function(){
  616. return smalltalk.withContext(function($ctx2) { return nil;
  617. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  618. return $1;
  619. }, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.Number)})},
  620. messageSends: ["at:ifAbsent:"]}),
  621. smalltalk.Number);
  622. smalltalk.addMethod(
  623. "_reverseTrapAt_put_",
  624. smalltalk.method({
  625. selector: "reverseTrapAt:put:",
  626. fn: function (anObject,value){
  627. var self=this;
  628. return smalltalk.withContext(function($ctx1) { var $1;
  629. $1=_st(anObject)._at_put_(self,value);
  630. return $1;
  631. }, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.Number)})},
  632. messageSends: ["at:put:"]}),
  633. smalltalk.Number);