Trapped-Backend.deploy.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. self["@getBlock"]=aBlock;
  10. return self}
  11. }),
  12. smalltalk.EavModel);
  13. smalltalk.addMethod(
  14. "_initialize",
  15. smalltalk.method({
  16. selector: "initialize",
  17. fn: function (){
  18. var self=this;
  19. smalltalk.send(self,"_initialize",[],smalltalk.Object);
  20. self["@getBlock"]=(function(){
  21. return smalltalk.send(self,"_error_",["No getter block."]);
  22. });
  23. self["@putBlock"]=(function(){
  24. return smalltalk.send(self,"_error_",["No putter block."]);
  25. });
  26. return self}
  27. }),
  28. smalltalk.EavModel);
  29. smalltalk.addMethod(
  30. "_on_",
  31. smalltalk.method({
  32. selector: "on:",
  33. fn: function (anObject){
  34. var self=this;
  35. var $1;
  36. $1=smalltalk.send(self["@getBlock"],"_value_",[anObject]);
  37. return $1;
  38. }
  39. }),
  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. var $1;
  48. $1=smalltalk.send(self["@putBlock"],"_value_value_",[anObject,anObject2]);
  49. return $1;
  50. }
  51. }),
  52. smalltalk.EavModel);
  53. smalltalk.addMethod(
  54. "_putBlock_",
  55. smalltalk.method({
  56. selector: "putBlock:",
  57. fn: function (aBlock){
  58. var self=this;
  59. self["@putBlock"]=aBlock;
  60. return self}
  61. }),
  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. newValue=smalltalk.send(aBlock,"_value_",[smalltalk.send(anEavModel,"_on_",[self])]);
  72. smalltalk.send(anEavModel,"_on_put_",[self,smalltalk.send(newValue,"_deepCopy",[])]);
  73. return self}
  74. }),
  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. smalltalk.send(aBlock,"_value_",[smalltalk.send(smalltalk.send(anEavModel,"_on_",[self]),"_deepCopy",[])]);
  83. return self}
  84. }),
  85. smalltalk.Isolator);
  86. smalltalk.addMethod(
  87. "_root",
  88. smalltalk.method({
  89. selector: "root",
  90. fn: function (){
  91. var self=this;
  92. return self["@root"];
  93. }
  94. }),
  95. smalltalk.Isolator);
  96. smalltalk.addMethod(
  97. "_root_",
  98. smalltalk.method({
  99. selector: "root:",
  100. fn: function (anObject){
  101. var self=this;
  102. self["@root"]=anObject;
  103. return self}
  104. }),
  105. smalltalk.Isolator);
  106. smalltalk.addMethod(
  107. "_on_",
  108. smalltalk.method({
  109. selector: "on:",
  110. fn: function (anObject){
  111. var self=this;
  112. var $1;
  113. $1=smalltalk.send(smalltalk.send(self,"_new",[]),"_root_",[anObject]);
  114. return $1;
  115. }
  116. }),
  117. smalltalk.Isolator.klass);