| Index: pkg/compiler/lib/src/compiler.dart
|
| diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
|
| index 0d6edac0eadb4d6f880645dc193f33c8d6f713c7..c9002c2cc803b65681de440a48342b7a8dac2d9f 100644
|
| --- a/pkg/compiler/lib/src/compiler.dart
|
| +++ b/pkg/compiler/lib/src/compiler.dart
|
| @@ -251,6 +251,9 @@ abstract class Backend {
|
| /// Backend callback methods for the resolution phase.
|
| ResolutionCallbacks get resolutionCallbacks;
|
|
|
| + // TODO(johnniwinther): Move this to the JavaScriptBackend.
|
| + String get patchVersion => null;
|
| +
|
| /// Set of classes that need to be considered for reflection although not
|
| /// otherwise visible during resolution.
|
| Iterable<ClassElement> classesRequiredForReflection = const [];
|
| @@ -800,8 +803,8 @@ abstract class Compiler implements DiagnosticListener {
|
| ConstantValue proxyConstant;
|
|
|
| // TODO(johnniwinther): Move this to the JavaScriptBackend.
|
| - /// The constant for the [patch] variable defined in dart:_js_helper.
|
| - ConstantValue patchConstant;
|
| + /// The class for patch annotation defined in dart:_js_helper.
|
| + ClassElement patchAnnotationClass;
|
|
|
| // TODO(johnniwinther): Move this to the JavaScriptBackend.
|
| ClassElement nativeAnnotationClass;
|
| @@ -1245,6 +1248,7 @@ abstract class Compiler implements DiagnosticListener {
|
| } else if (uri == DART_NATIVE_TYPED_DATA) {
|
| typedDataClass = findRequiredElement(library, 'NativeTypedData');
|
| } else if (uri == js_backend.JavaScriptBackend.DART_JS_HELPER) {
|
| + patchAnnotationClass = findRequiredElement(library, '_Patch');
|
| nativeAnnotationClass = findRequiredElement(library, 'Native');
|
| }
|
| return backend.onLibraryScanned(library, loader);
|
| @@ -1327,14 +1331,6 @@ abstract class Compiler implements DiagnosticListener {
|
| resolver.constantCompiler.compileConstant(
|
| coreLibrary.find('proxy')).value;
|
|
|
| - // TODO(johnniwinther): Move this to the JavaScript backend.
|
| - LibraryElement jsHelperLibrary = loadedLibraries.getLibrary(
|
| - js_backend.JavaScriptBackend.DART_JS_HELPER);
|
| - if (jsHelperLibrary != null) {
|
| - patchConstant = resolver.constantCompiler.compileConstant(
|
| - jsHelperLibrary.find('patch')).value;
|
| - }
|
| -
|
| if (preserveComments) {
|
| return libraryLoader.loadLibrary(DART_MIRRORS)
|
| .then((LibraryElement libraryElement) {
|
| @@ -1354,6 +1350,10 @@ abstract class Compiler implements DiagnosticListener {
|
| return element;
|
| }
|
|
|
| + // TODO(johnniwinther): Move this to [PatchParser] when it is moved to the
|
| + // [JavaScriptBackend]. Currently needed for testing.
|
| + String get patchVersion => backend.patchVersion;
|
| +
|
| void onClassResolved(ClassElement cls) {
|
| if (mirrorSystemClass == cls) {
|
| mirrorSystemGetNameFunction =
|
|
|