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

Side by Side Diff: lib/src/compiler.dart

Issue 49223002: fix webui for sdk 0.8.7 (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « lib/observe/set.dart ('k') | lib/src/html_css_fixup.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 compiler; 5 library compiler;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection' show SplayTreeMap; 8 import 'dart:collection' show SplayTreeMap;
9 import 'dart:json' as json; 9 import 'dart:convert';
10 import 'package:analyzer_experimental/src/generated/ast.dart' show Directive, Ur iBasedDirective; 10 import 'package:analyzer_experimental/src/generated/ast.dart' show Directive, Ur iBasedDirective;
11 import 'package:csslib/visitor.dart' show StyleSheet, treeToDebugString; 11 import 'package:csslib/visitor.dart' show StyleSheet, treeToDebugString;
12 import 'package:html5lib/dom.dart'; 12 import 'package:html5lib/dom.dart';
13 import 'package:html5lib/parser.dart'; 13 import 'package:html5lib/parser.dart';
14 import 'package:source_maps/span.dart' show Span; 14 import 'package:source_maps/span.dart' show Span;
15 15
16 import 'analyzer.dart'; 16 import 'analyzer.dart';
17 import 'code_printer.dart'; 17 import 'code_printer.dart';
18 import 'dart_parser.dart'; 18 import 'dart_parser.dart';
19 import 'emitters.dart'; 19 import 'emitters.dart';
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 if (printer == null) return; 754 if (printer == null) return;
755 755
756 var libPath = _pathMapper.outputLibraryPath(lib); 756 var libPath = _pathMapper.outputLibraryPath(lib);
757 var dir = path.dirname(libPath); 757 var dir = path.dirname(libPath);
758 var filename = path.basename(libPath); 758 var filename = path.basename(libPath);
759 printer.add('\n//# sourceMappingURL=$filename.map'); 759 printer.add('\n//# sourceMappingURL=$filename.map');
760 printer.build(libPath); 760 printer.build(libPath);
761 var sourcePath = dartCodeUrl != null ? dartCodeUrl.resolvedPath : null; 761 var sourcePath = dartCodeUrl != null ? dartCodeUrl.resolvedPath : null;
762 output.add(new OutputFile(libPath, printer.text, source: sourcePath)); 762 output.add(new OutputFile(libPath, printer.text, source: sourcePath));
763 // Fix-up the paths in the source map file 763 // Fix-up the paths in the source map file
764 var sourceMap = json.parse(printer.map); 764 var sourceMap = JSON.decode(printer.map);
765 var urls = sourceMap['sources']; 765 var urls = sourceMap['sources'];
766 for (int i = 0; i < urls.length; i++) { 766 for (int i = 0; i < urls.length; i++) {
767 urls[i] = path.relative(urls[i], from: dir); 767 urls[i] = path.relative(urls[i], from: dir);
768 } 768 }
769 output.add(new OutputFile(path.join(dir, '$filename.map'), 769 output.add(new OutputFile(path.join(dir, '$filename.map'),
770 json.stringify(sourceMap))); 770 JSON.encode(sourceMap)));
771 } 771 }
772 772
773 _time(String logMessage, String filePath, callback(), 773 _time(String logMessage, String filePath, callback(),
774 {bool printTime: false}) { 774 {bool printTime: false}) {
775 var message = new StringBuffer(); 775 var message = new StringBuffer();
776 message.write(logMessage); 776 message.write(logMessage);
777 var filename = path.basename(filePath); 777 var filename = path.basename(filePath);
778 for (int i = (60 - logMessage.length - filename.length); i > 0 ; i--) { 778 for (int i = (60 - logMessage.length - filename.length); i > 0 ; i--) {
779 message.write(' '); 779 message.write(' ');
780 } 780 }
(...skipping 28 matching lines...) Expand all
809 809
810 import 'package:web_ui/watcher.dart' as watcher; 810 import 'package:web_ui/watcher.dart' as watcher;
811 import '$userMainImport' as userMain; 811 import '$userMainImport' as userMain;
812 812
813 main() { 813 main() {
814 watcher.useObservers = $useObservers; 814 watcher.useObservers = $useObservers;
815 userMain.main(); 815 userMain.main();
816 userMain.init_autogenerated(); 816 userMain.init_autogenerated();
817 } 817 }
818 """; 818 """;
OLDNEW
« no previous file with comments | « lib/observe/set.dart ('k') | lib/src/html_css_fixup.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698