Trapped.deploy.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. smalltalk.addPackage('Trapped', {});
  2. smalltalk.addClass('EavModel', smalltalk.Object, ['getBlock', 'putBlock'], 'Trapped');
  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. self["@getBlock"]=(function(){
  20. return smalltalk.send(self,"_error_",["No getter block."]);
  21. });
  22. self["@putBlock"]=(function(){
  23. return smalltalk.send(self,"_error_",["No putter block."]);
  24. });
  25. return self}
  26. }),
  27. smalltalk.EavModel);
  28. smalltalk.addMethod(
  29. "_on_",
  30. smalltalk.method({
  31. selector: "on:",
  32. fn: function (anObject){
  33. var self=this;
  34. var $1;
  35. $1=smalltalk.send(self["@getBlock"],"_value_",[anObject]);
  36. return $1;
  37. }
  38. }),
  39. smalltalk.EavModel);
  40. smalltalk.addMethod(
  41. "_on_put_",
  42. smalltalk.method({
  43. selector: "on:put:",
  44. fn: function (anObject,anObject2){
  45. var self=this;
  46. var $1;
  47. $1=smalltalk.send(self["@putBlock"],"_value_value_",[anObject,anObject2]);
  48. return $1;
  49. }
  50. }),
  51. smalltalk.EavModel);
  52. smalltalk.addMethod(
  53. "_putBlock_",
  54. smalltalk.method({
  55. selector: "putBlock:",
  56. fn: function (aBlock){
  57. var self=this;
  58. self["@putBlock"]=aBlock;
  59. return self}
  60. }),
  61. smalltalk.EavModel);
  62. smalltalk.addClass('Isolator', smalltalk.Object, ['root'], 'Trapped');
  63. smalltalk.addMethod(
  64. "_model_read_",
  65. smalltalk.method({
  66. selector: "model:read:",
  67. fn: function (anEavModel,aBlock){
  68. var self=this;
  69. smalltalk.send(aBlock,"_value_",[smalltalk.send(smalltalk.send(anEavModel,"_on_",[self]),"_deepCopy",[])]);
  70. return self}
  71. }),
  72. smalltalk.Isolator);
  73. smalltalk.addMethod(
  74. "_root",
  75. smalltalk.method({
  76. selector: "root",
  77. fn: function (){
  78. var self=this;
  79. return self["@root"];
  80. }
  81. }),
  82. smalltalk.Isolator);
  83. smalltalk.addMethod(
  84. "_root_",
  85. smalltalk.method({
  86. selector: "root:",
  87. fn: function (anObject){
  88. var self=this;
  89. self["@root"]=anObject;
  90. return self}
  91. }),
  92. smalltalk.Isolator);
  93. smalltalk.addMethod(
  94. "_on_",
  95. smalltalk.method({
  96. selector: "on:",
  97. fn: function (anObject){
  98. var self=this;
  99. var $1;
  100. $1=smalltalk.send(smalltalk.send(self,"_new",[]),"_root_",[anObject]);
  101. return $1;
  102. }
  103. }),
  104. smalltalk.Isolator.klass);
  105. smalltalk.addClass('Trapped', smalltalk.Object, [], 'Trapped');