1
0

Compiler-Exceptions.deploy.js 5.1 KB

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