123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- define("amber/Compiler-Exceptions", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
- smalltalk.addPackage('Compiler-Exceptions');
- smalltalk.addClass('CompilerError', smalltalk.Error, [], 'Compiler-Exceptions');
- smalltalk.addClass('ParseError', smalltalk.CompilerError, [], 'Compiler-Exceptions');
- smalltalk.addClass('SemanticError', smalltalk.CompilerError, [], 'Compiler-Exceptions');
- smalltalk.addClass('InliningError', smalltalk.SemanticError, [], 'Compiler-Exceptions');
- smalltalk.addClass('InvalidAssignmentError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "messageText",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=" Invalid assignment to variable: ".__comma(self._variableName());
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.InvalidAssignmentError)})},
- messageSends: [",", "variableName"]}),
- smalltalk.InvalidAssignmentError);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "variableName",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@variableName"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"variableName",{},smalltalk.InvalidAssignmentError)})},
- messageSends: []}),
- smalltalk.InvalidAssignmentError);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "variableName:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@variableName"]=aString;
- return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString},smalltalk.InvalidAssignmentError)})},
- messageSends: []}),
- smalltalk.InvalidAssignmentError);
- smalltalk.addClass('ShadowingVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "messageText",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st("Variable shadowing error: ".__comma(self._variableName())).__comma(" is already defined");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.ShadowingVariableError)})},
- messageSends: [",", "variableName"]}),
- smalltalk.ShadowingVariableError);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "variableName",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@variableName"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"variableName",{},smalltalk.ShadowingVariableError)})},
- messageSends: []}),
- smalltalk.ShadowingVariableError);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "variableName:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@variableName"]=aString;
- return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString},smalltalk.ShadowingVariableError)})},
- messageSends: []}),
- smalltalk.ShadowingVariableError);
- smalltalk.addClass('UnknownVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "messageText",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st("Unknown Variable error: ".__comma(self._variableName())).__comma(" is not defined");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.UnknownVariableError)})},
- messageSends: [",", "variableName"]}),
- smalltalk.UnknownVariableError);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "variableName",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@variableName"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"variableName",{},smalltalk.UnknownVariableError)})},
- messageSends: []}),
- smalltalk.UnknownVariableError);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "variableName:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@variableName"]=aString;
- return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString},smalltalk.UnknownVariableError)})},
- messageSends: []}),
- smalltalk.UnknownVariableError);
- smalltalk.addClass('RethrowErrorHandler', smalltalk.ErrorHandler, [], 'Compiler-Exceptions');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "basicSignal:",
- fn: function (anError){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- throw anError;
- return self}, function($ctx1) {$ctx1.fill(self,"basicSignal:",{anError:anError},smalltalk.RethrowErrorHandler)})},
- messageSends: []}),
- smalltalk.RethrowErrorHandler);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "handleError:",
- fn: function (anError){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- smalltalk.RethrowErrorHandler.superclass.fn.prototype._handleError_.apply(_st(self), [anError]);
- self._basicSignal_(anError);
- return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.RethrowErrorHandler)})},
- messageSends: ["handleError:", "basicSignal:"]}),
- smalltalk.RethrowErrorHandler);
- });
|