Skip to content

Commit fc35778

Browse files
joshualittCommit Queue
authored and
Commit Queue
committed
[dart2wasm] Fix bug with print kernel.
Change-Id: I8ad7e1815af519dc511afc192f2e44621fa90be5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319820 Commit-Queue: Ömer Ağacan <[email protected]> Reviewed-by: Ömer Ağacan <[email protected]> Auto-Submit: Joshua Litt <[email protected]>
1 parent 7f08f8e commit fc35778

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/dart2wasm/lib/translator.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class Translator with KernelNodes {
303303
String? exportName = functions.getExport(reference);
304304

305305
if (options.printKernel || options.printWasm) {
306-
String header = "#${function.index}: $canonicalName";
306+
String header = "#${function.name}: $canonicalName";
307307
if (exportName != null) {
308308
header = "$header (exported as $exportName)";
309309
}
@@ -371,7 +371,7 @@ class Translator with KernelNodes {
371371
_printFunction(function, info.constant);
372372
} else {
373373
if (options.printWasm) {
374-
print("Global #${info.global.index}: ${info.constant}");
374+
print("Global #${info.global.name}: ${info.constant}");
375375
final global = info.global;
376376
if (global is w.GlobalBuilder) {
377377
print(global.initializer.trace);
@@ -386,7 +386,7 @@ class Translator with KernelNodes {
386386

387387
void _printFunction(w.BaseFunction function, Object name) {
388388
if (options.printWasm) {
389-
print("#${function.index}: $name");
389+
print("#${function.name}: $name");
390390
final f = function;
391391
if (f is w.FunctionBuilder) {
392392
print(f.body.trace);

0 commit comments

Comments
 (0)