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

Side by Side Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 1520293002: Add token invariant to DiagnosticReporter (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebase + status update Created 5 years 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/enum_creator.dart ('k') | pkg/compiler/lib/src/resolution/registry.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698