@@ -40,16 +40,17 @@ local function toString(this)
4040 return tconcat (t )
4141end
4242
43+ local function ctorOfException (this , message , innerException )
44+ this .message = message
45+ this .innerException = innerException
46+ end
47+
4348local Exception = define (" System.Exception" , {
4449 __tostring = toString ,
50+ __ctor__ = ctorOfException ,
4551 ToString = toString ,
4652 getMessage = getMessage ,
47-
48- __ctor__ = function (this , message , innerException )
49- this .message = message
50- this .innerException = innerException
51- end ,
52-
53+
5354 getInnerException = function (this )
5455 return this .innerException
5556 end ,
@@ -77,7 +78,7 @@ local ArgumentException = define("System.ArgumentException", {
7778 __inherits__ = { Exception },
7879
7980 __ctor__ = function (this , message , paramName , innerException )
80- System . Exception . __ctor__ (this , message or " Value does not fall within the expected range." , innerException )
81+ ctorOfException (this , message or " Value does not fall within the expected range." , innerException )
8182 this .paramName = paramName
8283 end ,
8384
@@ -126,7 +127,7 @@ define("System.IndexOutOfRangeException", {
126127 __inherits__ = { Exception },
127128
128129 __ctor__ = function (this , message , innerException )
129- Exception . __ctor__ (this , message or " Index was outside the bounds of the array." , innerException )
130+ ctorOfException (this , message or " Index was outside the bounds of the array." , innerException )
130131 end
131132})
132133
@@ -163,7 +164,7 @@ define("System.KeyNotFoundException", {
163164 __inherits__ = { Exception },
164165
165166 __ctor__ = function (this , message , innerException )
166- Exception . __ctor__ (this , message or " Key not found." , innerException )
167+ ctorOfException (this , message or " Key not found." , innerException )
167168 end
168169})
169170
@@ -172,7 +173,7 @@ local ArithmeticException = define("System.ArithmeticException", {
172173 __inherits__ = { Exception },
173174
174175 __ctor__ = function (this , message , innerException )
175- Exception . __ctor__ (this , message or " Overflow or underflow in the arithmetic operation." , innerException )
176+ ctorOfException (this , message or " Overflow or underflow in the arithmetic operation." , innerException )
176177 end
177178})
178179
@@ -199,7 +200,7 @@ define("System.FormatException", {
199200 __inherits__ = { Exception },
200201
201202 __ctor__ = function (this , message , innerException )
202- Exception . __ctor__ (this , message or " Invalid format." , innerException )
203+ ctorOfException (this , message or " Invalid format." , innerException )
203204 end
204205})
205206
@@ -208,7 +209,7 @@ define("System.InvalidCastException", {
208209 __inherits__ = { Exception },
209210
210211 __ctor__ = function (this , message , innerException )
211- Exception . __ctor__ (this , message or " The cast is not valid." , innerException )
212+ ctorOfException (this , message or " The cast is not valid." , innerException )
212213 end
213214})
214215
@@ -217,7 +218,7 @@ define("System.InvalidOperationException", {
217218 __inherits__ = { Exception },
218219
219220 __ctor__ = function (this , message , innerException )
220- Exception . __ctor__ (this , message or " Operation is not valid due to the current state of the object." , innerException )
221+ ctorOfException (this , message or " Operation is not valid due to the current state of the object." , innerException )
221222 end
222223})
223224
@@ -226,7 +227,7 @@ define("System.NotImplementedException", {
226227 __inherits__ = { Exception },
227228
228229 __ctor__ = function (this , message , innerException )
229- Exception . __ctor__ (this , message or " The method or operation is not implemented." , innerException )
230+ ctorOfException (this , message or " The method or operation is not implemented." , innerException )
230231 end
231232})
232233
@@ -235,7 +236,7 @@ define("System.NotSupportedException", {
235236 __inherits__ = { Exception },
236237
237238 __ctor__ = function (this , message , innerException )
238- Exception . __ctor__ (this , message or " Specified method is not supported." , innerException )
239+ ctorOfException (this , message or " Specified method is not supported." , innerException )
239240 end
240241})
241242
@@ -244,7 +245,7 @@ define("System.NullReferenceException", {
244245 __inherits__ = { Exception },
245246
246247 __ctor__ = function (this , message , innerException )
247- Exception . __ctor__ (this , message or " Object reference not set to an instance of an object." , innerException )
248+ ctorOfException (this , message or " Object reference not set to an instance of an object." , innerException )
248249 end
249250})
250251
@@ -253,7 +254,7 @@ define("System.RankException", {
253254 __inherits__ = { Exception },
254255
255256 __ctor__ = function (this , message , innerException )
256- Exception . __ctor__ (this , message or " Attempted to operate on an array with the incorrect number of dimensions." , innerException )
257+ ctorOfException (this , message or " Attempted to operate on an array with the incorrect number of dimensions." , innerException )
257258 end
258259})
259260
@@ -262,6 +263,6 @@ define("System.TypeLoadException", {
262263 __inherits__ = { Exception },
263264
264265 __ctor__ = function (this , message , innerException )
265- Exception . __ctor__ (this , message or " Failed when load type." , innerException )
266+ ctorOfException (this , message or " Failed when load type." , innerException )
266267 end
267268})
0 commit comments