Skip to content

Commit 0d08611

Browse files
Xinquan XUXMadrid
Xinquan XU
authored andcommitted
fix: addDebugInfo before convertExpression
1 parent 721236d commit 0d08611

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3449,6 +3449,9 @@ export class Compiler extends DiagnosticEmitter {
34493449
expr = this.module.unreachable();
34503450
}
34513451
}
3452+
// debug location is added here so the caller doesn't have to. means: compilation of an expression
3453+
// must go through this function, with the respective per-kind functions not being used directly.
3454+
if (this.options.sourceMap) this.addDebugLocation(expr, expression.range);
34523455
// ensure conversion and wrapping in case the respective function doesn't on its own
34533456
let currentType = this.currentType;
34543457
let wrap = (constraints & Constraints.MustWrap) != 0;
@@ -3462,9 +3465,6 @@ export class Compiler extends DiagnosticEmitter {
34623465
}
34633466
}
34643467
if (wrap) expr = this.ensureSmallIntegerWrap(expr, currentType);
3465-
// debug location is added here so the caller doesn't have to. means: compilation of an expression
3466-
// must go through this function, with the respective per-kind functions not being used directly.
3467-
if (this.options.sourceMap) this.addDebugLocation(expr, expression.range);
34683468
return expr;
34693469
}
34703470

0 commit comments

Comments
 (0)