File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ type TSTLCapturedErrorStack = Array<{
44 source : string ;
55 short_src : string ;
66 currentline : number ;
7- func : Function ;
87} > ;
98
109function __TS__GetErrorStack ( constructor : Function ) : TSTLCapturedErrorStack {
@@ -13,12 +12,12 @@ function __TS__GetErrorStack(constructor: Function): TSTLCapturedErrorStack {
1312 while ( true ) {
1413 const info = debug . getinfo ( level , "f" ) ;
1514 level += 1 ;
16- if ( info . func === constructor ) {
17- break ;
18- } else if ( ! info ) {
15+ if ( ! info ) {
1916 // constructor not in call stack
2017 level = 1 ;
2118 break ;
19+ } else if ( info . func === constructor ) {
20+ break ;
2221 }
2322 }
2423 while ( true ) {
@@ -53,7 +52,6 @@ function __TS__GetErrorString(this: void, error: Error): string {
5352function __TS__InitErrorClass ( Type : any ) : any {
5453 Type . prototype . __tostring = __TS__GetErrorString ;
5554 return setmetatable ( Type , {
56- __index : getmetatable ( Type ) ,
5755 __call : ( _self : any , message : string ) => new Type ( message ) ,
5856 } ) ;
5957}
You can’t perform that action at this time.
0 commit comments