diff --git a/pkg/dev_compiler/lib/src/compiler/reify_coercions.dart b/pkg/dev_compiler/lib/src/compiler/reify_coercions.dart index 9d0492b1a07..c0a9f723cda 100644 --- a/pkg/dev_compiler/lib/src/compiler/reify_coercions.dart +++ b/pkg/dev_compiler/lib/src/compiler/reify_coercions.dart @@ -31,7 +31,6 @@ class CoercionReifier extends analyzer.GeneralizingAstVisitor { return units.map(cr.visitCompilationUnit).toList(growable: false); } - /// Returns true if the `as` [node] was created by this class. // TODO(sra): Find a better way to recognize reified coercion, since we // can't set the isSynthetic attribute. diff --git a/pkg/dev_compiler/tool/global_compile.dart b/pkg/dev_compiler/tool/global_compile.dart index cded0c71ab4..b604099ec88 100644 --- a/pkg/dev_compiler/tool/global_compile.dart +++ b/pkg/dev_compiler/tool/global_compile.dart @@ -28,6 +28,8 @@ void main(List args) { defaultsTo: 'out.js') ..addFlag('unsafe-force-compile', help: 'Generate code with undefined behavior', negatable: false) + ..addFlag('emit-metadata', + help: 'Preserve annotations in generated code', negatable: false) ..addOption('package-root', help: 'Directory containing packages', abbr: 'p', @@ -47,16 +49,22 @@ void main(List args) { var unsafe = options['unsafe-force-compile'] as bool; var log = options['log'] as bool; var tmp = options['tmp'] as String; + var metadata = options['emit-metadata'] as bool; // Build an invocation to dartdevc var dartPath = Platform.resolvedExecutable; var ddcPath = path.dirname(path.dirname(Platform.script.toFilePath())); var template = [ '$ddcPath/bin/dartdevc.dart', - '--no-source-map', // Invalid as we're just concatenating files below + '--modules=legacy', // TODO(vsm): Change this to use common format. + '--single-out-file', + '--inline-source-map', '-p', packageRoot ]; + if (metadata) { + template.add('--emit-metadata'); + } if (unsafe) { template.add('--unsafe-force-compile'); } @@ -78,11 +86,12 @@ void main(List args) { // Prepend Dart runtime files to the output var out = new File(outfile); var dartLibrary = - new File(path.join(ddcPath, 'lib', 'runtime', 'dart_library.js')) + new File(path.join(ddcPath, 'lib', 'js', 'legacy', 'dart_library.js')) .readAsStringSync(); out.writeAsStringSync(dartLibrary); - var dartSdk = new File(path.join(ddcPath, 'lib', 'runtime', 'dart_sdk.js')) - .readAsStringSync(); + var dartSdk = + new File(path.join(ddcPath, 'lib', 'js', 'legacy', 'dart_sdk.js')) + .readAsStringSync(); out.writeAsStringSync(dartSdk, mode: FileMode.APPEND); // Linearize module concatenation for deterministic output