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

Unified Diff: packages/web_components/lib/build/html_import_annotation_recorder.dart

Issue 2312183003: Removed Polymer from Observatory deps (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/web_components/lib/build.log ('k') | packages/web_components/lib/build/import_inliner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/web_components/lib/build/html_import_annotation_recorder.dart
diff --git a/packages/web_components/lib/build/html_import_annotation_recorder.dart b/packages/web_components/lib/build/html_import_annotation_recorder.dart
index ba5d2abad5a99d35db6753f174c3bfba8e45399a..5f2a3200889bcdf86d5688ff44d9861719d5f20e 100644
--- a/packages/web_components/lib/build/html_import_annotation_recorder.dart
+++ b/packages/web_components/lib/build/html_import_annotation_recorder.dart
@@ -3,10 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
library web_components.build.html_import_recorder_inliner;
-import 'package:analyzer/analyzer.dart';
-import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
-import 'package:barback/barback.dart';
import 'package:initialize/transformer.dart';
import 'package:path/path.dart' as path;
import '../src/normalize_path.dart';
@@ -21,8 +18,6 @@ class HtmlImportAnnotationRecorder implements InitializerPlugin {
/// All the normalized import paths that were seen.
final Set<String> importPaths = new Set<String>();
- TransformLogger _logger;
-
HtmlImportAnnotationRecorder();
/// Applies to anything named `HtmlImport` which annotates a library.
@@ -35,8 +30,11 @@ class HtmlImportAnnotationRecorder implements InitializerPlugin {
} else if (annotationElement is PropertyAccessorElement) {
type = annotationElement.variable.propagatedType;
if (type == null) {
- type = pluginData.resolver.evaluateConstant(annotationElement.library,
- pluginData.initializer.annotationNode.name).value.type;
+ type = pluginData.resolver
+ .evaluateConstant(annotationElement.library,
+ pluginData.initializer.annotationNode.name)
+ .value
+ .type;
}
} else {
logger.error('Unsupported annotation type. Only constructors and '
@@ -60,18 +58,21 @@ class HtmlImportAnnotationRecorder implements InitializerPlugin {
var annotationElement = pluginData.initializer.annotationElement;
var element = pluginData.initializer.targetElement as LibraryElement;
var resolver = pluginData.resolver;
- var libraryDirective =
- pluginData.initializer.targetNode.parent.parent as LibraryDirective;
var originalImportPath;
if (annotationElement.element is PropertyAccessorElement) {
- originalImportPath = resolver.evaluateConstant(
- element.library, annotation.name).value.fields[
- 'filePath'].stringValue;
+ originalImportPath = resolver
+ .evaluateConstant(element.library, annotation.name)
+ .value
+ .fields['filePath']
+ .toStringValue();
} else {
assert(annotationElement.element is ConstructorElement);
- originalImportPath = resolver.evaluateConstant(element.library,
- annotation.arguments.arguments.first).value.stringValue;
+ originalImportPath = resolver
+ .evaluateConstant(
+ element.library, annotation.arguments.arguments.first)
+ .value
+ .toStringValue();
}
var libPath;
« no previous file with comments | « packages/web_components/lib/build.log ('k') | packages/web_components/lib/build/import_inliner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698