Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(860)

Side by Side Diff: lib/src/codegen/js_codegen.dart

Issue 1530133003: Support source maps in server mode (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dev_compiler.src.codegen.js_codegen; 5 library dev_compiler.src.codegen.js_codegen;
6 6
7 import 'dart:collection' show HashSet, HashMap, SplayTreeSet; 7 import 'dart:collection' show HashSet, HashMap, SplayTreeSet;
8 8
9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator;
10 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; 10 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator;
(...skipping 3482 matching lines...) Expand 10 before | Expand all | Expand 10 after
3493 3493
3494 String generateLibrary(LibraryUnit unit) { 3494 String generateLibrary(LibraryUnit unit) {
3495 // Clone the AST first, so we can mutate it. 3495 // Clone the AST first, so we can mutate it.
3496 unit = unit.clone(); 3496 unit = unit.clone();
3497 var library = unit.library.element.library; 3497 var library = unit.library.element.library;
3498 var fields = findFieldsNeedingStorage(unit, _extensionTypes); 3498 var fields = findFieldsNeedingStorage(unit, _extensionTypes);
3499 var codegen = 3499 var codegen =
3500 new JSCodegenVisitor(compiler, rules, library, _extensionTypes, fields); 3500 new JSCodegenVisitor(compiler, rules, library, _extensionTypes, fields);
3501 var module = codegen.emitLibrary(unit); 3501 var module = codegen.emitLibrary(unit);
3502 var out = compiler.getOutputPath(library.source.uri); 3502 var out = compiler.getOutputPath(library.source.uri);
3503 return writeJsLibrary(module, out, 3503 var flags = compiler.options;
3504 var serverUrl = flags.serverMode ? 'http://${flags.host}:${flags.port}/' : n ull;
Jennifer Messerly 2015/12/16 18:40:07 format?
vsm 2016/01/07 21:22:03 Done.
3505 return writeJsLibrary(module, out, compiler.inputBaseDir, serverUrl,
3504 emitSourceMaps: options.emitSourceMaps, 3506 emitSourceMaps: options.emitSourceMaps,
3505 arrowFnBindThisWorkaround: options.arrowFnBindThisWorkaround); 3507 arrowFnBindThisWorkaround: options.arrowFnBindThisWorkaround);
3506 } 3508 }
3507 } 3509 }
3508 3510
3509 /// Choose a canonical name from the library element. 3511 /// Choose a canonical name from the library element.
3510 /// This never uses the library's name (the identifier in the `library` 3512 /// This never uses the library's name (the identifier in the `library`
3511 /// declaration) as it doesn't have any meaningful rules enforced. 3513 /// declaration) as it doesn't have any meaningful rules enforced.
3512 String jsLibraryName(LibraryElement library) => canonicalLibraryName(library); 3514 String jsLibraryName(LibraryElement library) => canonicalLibraryName(library);
3513 3515
(...skipping 10 matching lines...) Expand all
3524 3526
3525 /// A special kind of element created by the compiler, signifying a temporary 3527 /// A special kind of element created by the compiler, signifying a temporary
3526 /// variable. These objects use instance equality, and should be shared 3528 /// variable. These objects use instance equality, and should be shared
3527 /// everywhere in the tree where they are treated as the same variable. 3529 /// everywhere in the tree where they are treated as the same variable.
3528 class TemporaryVariableElement extends LocalVariableElementImpl { 3530 class TemporaryVariableElement extends LocalVariableElementImpl {
3529 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name); 3531 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name);
3530 3532
3531 int get hashCode => identityHashCode(this); 3533 int get hashCode => identityHashCode(this);
3532 bool operator ==(Object other) => identical(this, other); 3534 bool operator ==(Object other) => identical(this, other);
3533 } 3535 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698