From 65951ef5080bcfa7d8862685e96f75c2c5d17841 Mon Sep 17 00:00:00 2001 From: Jenny Messerly Date: Wed, 7 Nov 2018 23:39:17 +0000 Subject: [PATCH] [dartdevc] fix debugger extension console, take 2 This change fixes the (internal) debugger console test so it passes. A few of the fixes did not make it into the previous CL (CL https://dart-review.googlesource.com/c/sdk/+/83140). Change-Id: I58df9024b96e73a13a5c13b801be237450cfe3cb Reviewed-on: https://dart-review.googlesource.com/c/83522 Auto-Submit: Jenny Messerly Reviewed-by: Alan Knight Commit-Queue: Keerti Parthasarathy --- pkg/dev_compiler/lib/src/compiler/shared_command.dart | 7 +++++-- pkg/dev_compiler/web/web_command.dart | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/dev_compiler/lib/src/compiler/shared_command.dart b/pkg/dev_compiler/lib/src/compiler/shared_command.dart index a136652bb9a..ddb903c389f 100644 --- a/pkg/dev_compiler/lib/src/compiler/shared_command.dart +++ b/pkg/dev_compiler/lib/src/compiler/shared_command.dart @@ -149,9 +149,12 @@ class SharedCompilerOptions { : (outPaths as List) .firstWhere((_) => true, orElse: () => null); + // TODO(jmesserly): fix the debugger console so it's not passing invalid + // options. + if (outPath == null) return null; if (moduleRoot != null) { - // TODO(jmesserly): remove this legacy support after a deprecation period. - // (Mainly this is to give time for migrating build rules.) + // TODO(jmesserly): remove this legacy support after a deprecation + // period. (Mainly this is to give time for migrating build rules.) moduleName = path.withoutExtension(path.relative(outPath, from: moduleRoot)); } else { diff --git a/pkg/dev_compiler/web/web_command.dart b/pkg/dev_compiler/web/web_command.dart index ac2b54f25ac..2904b5afe33 100644 --- a/pkg/dev_compiler/web/web_command.dart +++ b/pkg/dev_compiler/web/web_command.dart @@ -285,13 +285,13 @@ class WebCompileCommand extends Command { } resources.newFile(fileName, sourceCode); - compilerOptions.moduleName = path.toUri(libraryName).toString(); + var name = path.toUri(libraryName).toString(); + compilerOptions.moduleName = name; JSModuleFile module = compileWithAnalyzer(driver, [fileName], options, compilerOptions); var moduleCode = ''; if (module.isValid) { - var name = compilerOptions.moduleName; moduleCode = module.getCode(ModuleFormat.legacyConcat, name, name + '.map').code; }