Index: pkg/compiler/lib/src/native/resolver.dart |
diff --git a/pkg/compiler/lib/src/native/resolver.dart b/pkg/compiler/lib/src/native/resolver.dart |
index 5d055ccd356883267dd2f0a6a60d668862a1cda7..b7163e9a559a7c88cc5b0816bc9d2ef3b9ba2a82 100644 |
--- a/pkg/compiler/lib/src/native/resolver.dart |
+++ b/pkg/compiler/lib/src/native/resolver.dart |
@@ -7,6 +7,7 @@ import 'package:front_end/src/fasta/scanner.dart' |
import 'package:front_end/src/fasta/scanner.dart' as Tokens show EOF_TOKEN; |
import '../common.dart'; |
+import '../common_elements.dart' show CommonElements; |
import '../common/backend_api.dart'; |
import '../common/resolution.dart'; |
import '../compiler.dart' show Compiler; |
@@ -23,7 +24,6 @@ import '../elements/elements.dart' |
import '../elements/entities.dart'; |
import '../elements/modelx.dart' show FunctionElementX, MetadataAnnotationX; |
import '../elements/resolution_types.dart' show ResolutionDartType; |
-import '../js_backend/backend_helpers.dart'; |
import '../js_backend/js_backend.dart'; |
import '../js_backend/native_data.dart'; |
import '../patch_parser.dart'; |
@@ -227,7 +227,8 @@ class NativeDataResolverImpl implements NativeDataResolver { |
/// present. |
String _findJsNameFromAnnotation(Element element) { |
String name = null; |
- ClassElement annotationClass = _backend.helpers.annotationJSNameClass; |
+ ClassElement annotationClass = |
+ _compiler.commonElements.annotationJSNameClass; |
for (MetadataAnnotation annotation in element.implementation.metadata) { |
annotation.ensureResolved(_compiler.resolution); |
ConstantValue value = |
@@ -319,7 +320,7 @@ class NativeAnnotationHandler extends EagerAnnotationHandler<String> { |
ResolutionDartType annotationType = |
constant.getType(compiler.commonElements); |
if (annotationType.element != |
- compiler.backend.helpers.nativeAnnotationClass) { |
+ compiler.commonElements.nativeAnnotationClass) { |
DiagnosticReporter reporter = compiler.reporter; |
reporter.internalError(annotation, 'Invalid @Native(...) annotation.'); |
} |
@@ -373,9 +374,8 @@ class JsInteropAnnotationHandler implements EagerAnnotationHandler<bool> { |
@override |
void validate(Compiler compiler, Element element, |
MetadataAnnotation annotation, ConstantValue constant) { |
- JavaScriptBackend backend = compiler.backend; |
ResolutionDartType type = constant.getType(compiler.commonElements); |
- if (type.element != backend.helpers.jsAnnotationClass) { |
+ if (type.element != compiler.commonElements.jsAnnotationClass) { |
compiler.reporter |
.internalError(annotation, 'Invalid @JS(...) annotation.'); |
} |
@@ -392,21 +392,21 @@ abstract class NativeClassResolver { |
class NativeClassResolverImpl implements NativeClassResolver { |
final DiagnosticReporter _reporter; |
final Resolution _resolution; |
- final BackendHelpers _helpers; |
+ final CommonElements _commonElements; |
final NativeBasicData _nativeBasicData; |
Map<String, ClassElement> _tagOwner = new Map<String, ClassElement>(); |
- NativeClassResolverImpl( |
- this._resolution, this._reporter, this._helpers, this._nativeBasicData); |
+ NativeClassResolverImpl(this._resolution, this._reporter, |
+ this._commonElements, this._nativeBasicData); |
Iterable<ClassElement> computeNativeClasses( |
Iterable<LibraryElement> libraries) { |
Set<ClassElement> nativeClasses = new Set<ClassElement>(); |
libraries.forEach((l) => _processNativeClassesInLibrary(l, nativeClasses)); |
- if (_helpers.isolateHelperLibrary != null) { |
+ if (_commonElements.isolateHelperLibrary != null) { |
_processNativeClassesInLibrary( |
- _helpers.isolateHelperLibrary, nativeClasses); |
+ _commonElements.isolateHelperLibrary, nativeClasses); |
} |
_processSubclassesOfNativeClasses(libraries, nativeClasses); |
return nativeClasses; |