2
0

Compiler-Exceptions.deploy.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. smalltalk.addPackage('Compiler-Exceptions', {});
  2. smalltalk.addClass('CompilerError', smalltalk.Error, [], 'Compiler-Exceptions');
  3. smalltalk.addClass('ParseError', smalltalk.CompilerError, [], 'Compiler-Exceptions');
  4. smalltalk.addClass('SemanticError', smalltalk.CompilerError, [], 'Compiler-Exceptions');
  5. smalltalk.addClass('InliningError', smalltalk.SemanticError, [], 'Compiler-Exceptions');
  6. smalltalk.addClass('InvalidAssignmentError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  7. smalltalk.addMethod(
  8. "_messageText",
  9. smalltalk.method({
  10. selector: "messageText",
  11. fn: function (){
  12. var self=this;
  13. return smalltalk.withContext(function($ctx1) { var $1;
  14. $1=_st(" Invalid assignment to variable: ").__comma(_st(self)._variableName());
  15. return $1;
  16. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.InvalidAssignmentError)})},
  17. messageSends: [",", "variableName"]}),
  18. smalltalk.InvalidAssignmentError);
  19. smalltalk.addMethod(
  20. "_variableName",
  21. smalltalk.method({
  22. selector: "variableName",
  23. fn: function (){
  24. var self=this;
  25. return smalltalk.withContext(function($ctx1) { var $1;
  26. $1=self["@variableName"];
  27. return $1;
  28. }, function($ctx1) {$ctx1.fill(self,"variableName",{}, smalltalk.InvalidAssignmentError)})},
  29. messageSends: []}),
  30. smalltalk.InvalidAssignmentError);
  31. smalltalk.addMethod(
  32. "_variableName_",
  33. smalltalk.method({
  34. selector: "variableName:",
  35. fn: function (aString){
  36. var self=this;
  37. return smalltalk.withContext(function($ctx1) { self["@variableName"]=aString;
  38. return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString}, smalltalk.InvalidAssignmentError)})},
  39. messageSends: []}),
  40. smalltalk.InvalidAssignmentError);
  41. smalltalk.addClass('ShadowingVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  42. smalltalk.addMethod(
  43. "_messageText",
  44. smalltalk.method({
  45. selector: "messageText",
  46. fn: function (){
  47. var self=this;
  48. return smalltalk.withContext(function($ctx1) { var $1;
  49. $1=_st(_st("Variable shadowing error: ").__comma(_st(self)._variableName())).__comma(" is already defined");
  50. return $1;
  51. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.ShadowingVariableError)})},
  52. messageSends: [",", "variableName"]}),
  53. smalltalk.ShadowingVariableError);
  54. smalltalk.addMethod(
  55. "_variableName",
  56. smalltalk.method({
  57. selector: "variableName",
  58. fn: function (){
  59. var self=this;
  60. return smalltalk.withContext(function($ctx1) { var $1;
  61. $1=self["@variableName"];
  62. return $1;
  63. }, function($ctx1) {$ctx1.fill(self,"variableName",{}, smalltalk.ShadowingVariableError)})},
  64. messageSends: []}),
  65. smalltalk.ShadowingVariableError);
  66. smalltalk.addMethod(
  67. "_variableName_",
  68. smalltalk.method({
  69. selector: "variableName:",
  70. fn: function (aString){
  71. var self=this;
  72. return smalltalk.withContext(function($ctx1) { self["@variableName"]=aString;
  73. return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString}, smalltalk.ShadowingVariableError)})},
  74. messageSends: []}),
  75. smalltalk.ShadowingVariableError);
  76. smalltalk.addClass('UnknownVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  77. smalltalk.addMethod(
  78. "_messageText",
  79. smalltalk.method({
  80. selector: "messageText",
  81. fn: function (){
  82. var self=this;
  83. return smalltalk.withContext(function($ctx1) { var $1;
  84. $1=_st(_st("Unknown Variable error: ").__comma(_st(self)._variableName())).__comma(" is not defined");
  85. return $1;
  86. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.UnknownVariableError)})},
  87. messageSends: [",", "variableName"]}),
  88. smalltalk.UnknownVariableError);
  89. smalltalk.addMethod(
  90. "_variableName",
  91. smalltalk.method({
  92. selector: "variableName",
  93. fn: function (){
  94. var self=this;
  95. return smalltalk.withContext(function($ctx1) { var $1;
  96. $1=self["@variableName"];
  97. return $1;
  98. }, function($ctx1) {$ctx1.fill(self,"variableName",{}, smalltalk.UnknownVariableError)})},
  99. messageSends: []}),
  100. smalltalk.UnknownVariableError);
  101. smalltalk.addMethod(
  102. "_variableName_",
  103. smalltalk.method({
  104. selector: "variableName:",
  105. fn: function (aString){
  106. var self=this;
  107. return smalltalk.withContext(function($ctx1) { self["@variableName"]=aString;
  108. return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString}, smalltalk.UnknownVariableError)})},
  109. messageSends: []}),
  110. smalltalk.UnknownVariableError);
  111. smalltalk.addClass('RethrowErrorHandler', smalltalk.ErrorHandler, [], 'Compiler-Exceptions');
  112. smalltalk.addMethod(
  113. "_basicSignal_",
  114. smalltalk.method({
  115. selector: "basicSignal:",
  116. fn: function (anError){
  117. var self=this;
  118. return smalltalk.withContext(function($ctx1) { throw anError;
  119. return self}, function($ctx1) {$ctx1.fill(self,"basicSignal:",{anError:anError}, smalltalk.RethrowErrorHandler)})},
  120. messageSends: []}),
  121. smalltalk.RethrowErrorHandler);
  122. smalltalk.addMethod(
  123. "_handleError_",
  124. smalltalk.method({
  125. selector: "handleError:",
  126. fn: function (anError){
  127. var self=this;
  128. return smalltalk.withContext(function($ctx1) { smalltalk.ErrorHandler.fn.prototype._handleError_.apply(_st(self), [anError]);
  129. _st(self)._basicSignal_(anError);
  130. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError}, smalltalk.RethrowErrorHandler)})},
  131. messageSends: ["handleError:", "basicSignal:"]}),
  132. smalltalk.RethrowErrorHandler);