Linter Demo Errors: 3Warnings: 2File: /home/fstrocco/Dart/dart/benchmark/devcompiler/lib/src/codegen/html_codegen.dart // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library dev_compiler.src.codegen.html_codegen; import 'package:html/dom.dart'; import 'package:html/parser.dart' show parseFragment; import 'package:logging/logging.dart' show Logger; import 'package:path/path.dart' as path; import 'package:dev_compiler/src/dependency_graph.dart'; import 'package:dev_compiler/src/options.dart'; import 'package:dev_compiler/src/utils.dart' show colorOf, resourceOutputPath; import 'js_codegen.dart' show jsOutputPath, jsOutputBase; /// Emits an entry point HTML file corresponding to [inputFile] that can load /// the code generated by the dev compiler. /// /// This internally transforms the given HTML [document]. When compiling to /// JavaScript, we remove any Dart script tags, add new script tags to load our /// runtime and the compiled code, and to execute the main method of the /// application. When compiling to Dart, we ensure that the document contains a /// single Dart script tag, but otherwise emit the original document /// unmodified. String generateEntryHtml(HtmlSourceNode root, CompilerOptions options) { var document = root.document.clone(true); var scripts = document.querySelectorAll('script[type="application/dart"]'); if (scripts.isEmpty) { _log.warning('No \n'); /// A script tag that invokes the main function on the entry point library. Node _invokeMain(String mainLibraryName) { var code = mainLibraryName == null ? 'console.error("dev_compiler error: main was not generated");' // TODO(vsm): Can we simplify this? // See: https://github.com/dart-lang/dev_compiler/issues/164 : "dart.start('$mainLibraryName');"; return parseFragment('\n'); } /// Convert the outputPath to include the hash in it. This function is the /// reverse of what the server does to determine whether a request needs to have /// cache headers added to it. _addHash(String outPath, String hash) { // (the ____ prefix makes it look better in the web inspector) return '$outPath?____cached=$hash'; } final _log = new Logger('dev_compiler.src.codegen.html_codegen');