Browse Source

UnknownVariableError: add >>messageText

Manfred Kroehnert 12 years ago
parent
commit
0007083ebf
3 changed files with 35 additions and 0 deletions
  1. 13 0
      js/Compiler-Exceptions.deploy.js
  2. 18 0
      js/Compiler-Exceptions.js
  3. 4 0
      st/Compiler-Exceptions.st

+ 13 - 0
js/Compiler-Exceptions.deploy.js

@@ -88,6 +88,19 @@ smalltalk.ShadowingVariableError);
 
 
 smalltalk.addClass('UnknownVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
+smalltalk.addMethod(
+"_messageText",
+smalltalk.method({
+selector: "messageText",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send("Unknown Variable error: ","__comma",[smalltalk.send(self,"_variableName",[])]),"__comma",[" is not defined"]);
+return $1;
+}
+}),
+smalltalk.UnknownVariableError);
+
 smalltalk.addMethod(
 "_variableName",
 smalltalk.method({

+ 18 - 0
js/Compiler-Exceptions.js

@@ -125,6 +125,24 @@ smalltalk.ShadowingVariableError);
 
 smalltalk.addClass('UnknownVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
 smalltalk.UnknownVariableError.comment="I get signaled when a variable is not defined.\x0aThe default behavior is to allow it, as this is how Amber currently is able to seamlessly send messages to JavaScript objects."
+smalltalk.addMethod(
+"_messageText",
+smalltalk.method({
+selector: "messageText",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send("Unknown Variable error: ","__comma",[smalltalk.send(self,"_variableName",[])]),"__comma",[" is not defined"]);
+return $1;
+},
+args: [],
+source: "messageText\x0a\x09^ 'Unknown Variable error: ', self variableName, ' is not defined'",
+messageSends: [",", "variableName"],
+referencedClasses: []
+}),
+smalltalk.UnknownVariableError);
+
 smalltalk.addMethod(
 "_variableName",
 smalltalk.method({

+ 4 - 0
st/Compiler-Exceptions.st

@@ -77,6 +77,10 @@ The default behavior is to allow it, as this is how Amber currently is able to s
 
 !UnknownVariableError methodsFor: 'accessing'!
 
+messageText
+	^ 'Unknown Variable error: ', self variableName, ' is not defined'
+!
+
 variableName
 	^ variableName
 !