1
0

Compiler-Exceptions.deploy.js 5.0 KB

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