File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -9830,7 +9830,7 @@ export class Compiler extends DiagnosticEmitter {
9830
9830
let targetFunction = this . currentFlow . targetFunction ;
9831
9831
let source = range . source ;
9832
9832
if ( source . debugInfoIndex < 0 ) source . debugInfoIndex = this . module . addDebugInfoFile ( source . normalizedPath ) ;
9833
- range . debugInfoRef = expr ;
9833
+ range . debugInfo . set ( targetFunction . internalName , expr ) ;
9834
9834
targetFunction . debugLocations . push ( range ) ;
9835
9835
}
9836
9836
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
DiagnosticCode ,
12
12
diagnosticCodeToString
13
13
} from "./diagnosticMessages.generated" ;
14
+ import { ExpressionRef } from "./module" ;
14
15
15
16
import {
16
17
isLineBreak ,
@@ -45,7 +46,7 @@ export const enum DiagnosticCategory {
45
46
export class Range {
46
47
47
48
source ! : Source ;
48
- debugInfoRef : usize = 0 ;
49
+ debugInfo : Map < string , ExpressionRef > = new Map < string , ExpressionRef > ( ) ;
49
50
50
51
constructor ( public start : i32 , public end : i32 ) { }
51
52
Original file line number Diff line number Diff line change @@ -118,7 +118,8 @@ import {
118
118
Module ,
119
119
FunctionRef ,
120
120
MemorySegment ,
121
- getFunctionName
121
+ getFunctionName ,
122
+ ExpressionRef
122
123
} from "./module" ;
123
124
124
125
import {
@@ -3916,9 +3917,11 @@ export class Function extends TypedElement {
3916
3917
for ( let i = 0 , k = debugLocations . length ; i < k ; ++ i ) {
3917
3918
let range = debugLocations [ i ] ;
3918
3919
let source = range . source ;
3920
+ const debugInfo = range . debugInfo . get ( this . internalName ) ;
3921
+ assert ( debugInfo ) ;
3919
3922
module . setDebugLocation (
3920
3923
ref ,
3921
- range . debugInfoRef ,
3924
+ debugInfo as ExpressionRef ,
3922
3925
source . debugInfoIndex ,
3923
3926
source . lineAt ( range . start ) ,
3924
3927
source . columnAt ( ) - 1 // source maps are 0-based
You can’t perform that action at this time.
0 commit comments