OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library dart2js.resolution.members; | 5 library dart2js.resolution.members; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/names.dart' show | 8 import '../common/names.dart' show |
9 Selectors; | 9 Selectors; |
10 import '../common/resolution.dart' show | 10 import '../common/resolution.dart' show |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 // This is just to guard against internal errors, so no need | 795 // This is just to guard against internal errors, so no need |
796 // for a real error message. | 796 // for a real error message. |
797 ErroneousElement error = reportAndCreateErroneousElement( | 797 ErroneousElement error = reportAndCreateErroneousElement( |
798 node, 'super', | 798 node, 'super', |
799 MessageKind.GENERIC, | 799 MessageKind.GENERIC, |
800 {'text': "Object has no superclass"}, | 800 {'text': "Object has no superclass"}, |
801 isError: true); | 801 isError: true); |
802 registry.registerFeature(Feature.COMPILE_TIME_ERROR); | 802 registry.registerFeature(Feature.COMPILE_TIME_ERROR); |
803 return new StaticAccess.invalid(error); | 803 return new StaticAccess.invalid(error); |
804 } | 804 } |
805 registry.registerSuperUse(node); | 805 registry.registerSuperUse(reporter.spanFromSpannable(node)); |
806 return null; | 806 return null; |
807 } | 807 } |
808 | 808 |
809 /// Check that access to `this` is currently allowed. Returns an | 809 /// Check that access to `this` is currently allowed. Returns an |
810 /// [AccessSemantics] in case of an error, `null` otherwise. | 810 /// [AccessSemantics] in case of an error, `null` otherwise. |
811 AccessSemantics checkThisAccess(Send node) { | 811 AccessSemantics checkThisAccess(Send node) { |
812 if (!inInstanceContext) { | 812 if (!inInstanceContext) { |
813 ErroneousElement error = reportAndCreateErroneousElement( | 813 ErroneousElement error = reportAndCreateErroneousElement( |
814 node, 'this', | 814 node, 'this', |
815 MessageKind.NO_THIS_AVAILABLE, const {}, | 815 MessageKind.NO_THIS_AVAILABLE, const {}, |
(...skipping 4048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4864 } | 4864 } |
4865 return const NoneResult(); | 4865 return const NoneResult(); |
4866 } | 4866 } |
4867 } | 4867 } |
4868 | 4868 |
4869 /// Looks up [name] in [scope] and unwraps the result. | 4869 /// Looks up [name] in [scope] and unwraps the result. |
4870 Element lookupInScope(DiagnosticReporter reporter, Node node, | 4870 Element lookupInScope(DiagnosticReporter reporter, Node node, |
4871 Scope scope, String name) { | 4871 Scope scope, String name) { |
4872 return Elements.unwrap(scope.lookup(name), reporter, node); | 4872 return Elements.unwrap(scope.lookup(name), reporter, node); |
4873 } | 4873 } |
OLD | NEW |