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

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

Issue 1268813003: format with dart_style 0.2.0 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 4 months 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 | « bin/devrun.dart ('k') | lib/src/runner/runtime_utils.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) 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.html_codegen; 5 library dev_compiler.src.codegen.html_codegen;
6 6
7 import 'package:html/dom.dart'; 7 import 'package:html/dom.dart';
8 import 'package:html/parser.dart' show parseFragment; 8 import 'package:html/parser.dart' show parseFragment;
9 import 'package:logging/logging.dart' show Logger; 9 import 'package:logging/logging.dart' show Logger;
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 23 matching lines...) Expand all
34 // TODO(sigmund): allow more than one Dart script tags? 34 // TODO(sigmund): allow more than one Dart script tags?
35 _log.warning(s.sourceSpan.message( 35 _log.warning(s.sourceSpan.message(
36 'unexpected script. Only one Dart script tag allowed ' 36 'unexpected script. Only one Dart script tag allowed '
37 '(see https://github.com/dart-lang/dart-dev-compiler/issues/53).', 37 '(see https://github.com/dart-lang/dart-dev-compiler/issues/53).',
38 color: options.useColors ? colorOf('warning') : false)); 38 color: options.useColors ? colorOf('warning') : false));
39 s.remove(); 39 s.remove();
40 }); 40 });
41 41
42 var libraries = []; 42 var libraries = [];
43 var resources = new Set(); 43 var resources = new Set();
44 visitInPostOrder( 44 visitInPostOrder(root, (n) {
45 root, 45 if (n is DartSourceNode) libraries.add(n);
46 (n) { 46 if (n is ResourceSourceNode) resources.add(n);
47 if (n is DartSourceNode) libraries.add(n); 47 }, includeParts: false);
48 if (n is ResourceSourceNode) resources.add(n);
49 },
50 includeParts: false);
51 48
52 root.htmlResourceNodes.forEach((element, resource) { 49 root.htmlResourceNodes.forEach((element, resource) {
53 // Make sure we don't try and add this node again. 50 // Make sure we don't try and add this node again.
54 resources.remove(resource); 51 resources.remove(resource);
55 52
56 var resourcePath = 53 var resourcePath =
57 resourceOutputPath(resource.uri, root.uri, options.runtimeDir); 54 resourceOutputPath(resource.uri, root.uri, options.runtimeDir);
58 if (resource.cachingHash != null) { 55 if (resource.cachingHash != null) {
59 resourcePath = _addHash(resourcePath, resource.cachingHash); 56 resourcePath = _addHash(resourcePath, resource.cachingHash);
60 } 57 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 119
123 /// Convert the outputPath to include the hash in it. This function is the 120 /// Convert the outputPath to include the hash in it. This function is the
124 /// reverse of what the server does to determine whether a request needs to have 121 /// reverse of what the server does to determine whether a request needs to have
125 /// cache headers added to it. 122 /// cache headers added to it.
126 _addHash(String outPath, String hash) { 123 _addHash(String outPath, String hash) {
127 // (the ____ prefix makes it look better in the web inspector) 124 // (the ____ prefix makes it look better in the web inspector)
128 return '$outPath?____cached=$hash'; 125 return '$outPath?____cached=$hash';
129 } 126 }
130 127
131 final _log = new Logger('dev_compiler.src.codegen.html_codegen'); 128 final _log = new Logger('dev_compiler.src.codegen.html_codegen');
OLDNEW
« no previous file with comments | « bin/devrun.dart ('k') | lib/src/runner/runtime_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698