| Index: dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| index 93fd69cce8f4b4cf7a0478ec2b4480eb127528be..f2f887a13bb7107187d15272df8a09d704c1e4a8 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| @@ -306,6 +306,11 @@ abstract class Compiler implements DiagnosticListener {
|
| ClassElement listClass;
|
| ClassElement typeClass;
|
| ClassElement mapClass;
|
| + ClassElement symbolClass;
|
| + FunctionElement symbolConstructor;
|
| + ClassElement mirrorSystemClass;
|
| + FunctionElement mirrorSystemGetNameFunction;
|
| +
|
| ClassElement jsInvocationMirrorClass;
|
| /// Document class from dart:mirrors.
|
| ClassElement documentClass;
|
| @@ -616,6 +621,19 @@ abstract class Compiler implements DiagnosticListener {
|
| library.addToScope(dynamicClass, this);
|
| });
|
| }
|
| + if (uri == Uri.parse('dart:mirrors')) {
|
| + mirrorSystemClass = library.find(const SourceString('MirrorSystem'));
|
| + print(mirrorSystemClass);
|
| + }
|
| + }
|
| +
|
| + void onClassResolved(ClassElement cls) {
|
| + if (mirrorSystemClass == cls) {
|
| + mirrorSystemGetNameFunction =
|
| + cls.lookupLocalMember(const SourceString('getName'));
|
| + } else if (symbolClass == cls) {
|
| + symbolConstructor = cls.constructors.head;
|
| + }
|
| }
|
|
|
| LibraryElement scanBuiltinLibrary(String filename);
|
| @@ -645,6 +663,11 @@ abstract class Compiler implements DiagnosticListener {
|
| '$missingCoreClasses');
|
| }
|
|
|
| + // The following classes may not exist.
|
| + // TODO(ahe): It is possible that we have to require the presence
|
| + // of Symbol as we change how we implement noSuchMethod.
|
| + symbolClass = lookupCoreClass('Symbol');
|
| +
|
| final List missingHelperClasses = [];
|
| ClassElement lookupHelperClass(String name) {
|
| ClassElement result = jsHelperLibrary.find(new SourceString(name));
|
| @@ -1013,6 +1036,14 @@ abstract class Compiler implements DiagnosticListener {
|
| api.Diagnostic.ERROR);
|
| }
|
|
|
| + // TODO(ahe): Rename to reportWarning when that method has been removed.
|
| + void reportWarningCode(Spannable node, MessageKind errorCode,
|
| + [Map arguments = const {}]) {
|
| + reportMessage(spanFromSpannable(node),
|
| + errorCode.error(arguments),
|
| + api.Diagnostic.WARNING);
|
| + }
|
| +
|
| void reportMessage(SourceSpan span, Diagnostic message, api.Diagnostic kind) {
|
| // TODO(ahe): The names Diagnostic and api.Diagnostic are in
|
| // conflict. Fix it.
|
|
|