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

Unified Diff: pkg/compiler/lib/src/native/resolver.dart

Issue 2982783003: Use failedAt in more places (Closed)
Patch Set: Created 3 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/kernel/native_basic_data.dart ('k') | pkg/compiler/lib/src/native/ssa.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 142b9975232d860db9f9501c378dec898cacd19c..885efca56e7be0f8a54c8bf8c274ec87bcaef7d5 100644
--- a/pkg/compiler/lib/src/native/resolver.dart
+++ b/pkg/compiler/lib/src/native/resolver.dart
@@ -178,7 +178,7 @@ abstract class NativeMemberResolverBase implements NativeMemberResolver {
List<String> nativeNames =
nativeBasicData.getNativeTagsOfClass(element.enclosingClass);
if (nativeNames.length != 1) {
- throw new SpannableAssertionFailure(
+ failedAt(
element,
'Unable to determine a native name for the enclosing class, '
'options: $nativeNames');
@@ -201,8 +201,7 @@ abstract class NativeMemberResolverBase implements NativeMemberResolver {
if (jsName == null) {
jsName = name;
} else if (name != null) {
- throw new SpannableAssertionFailure(
- element, 'Too many JSName annotations: ${value.toDartText()}');
+ failedAt(element, 'Too many JSName annotations: ${value.toDartText()}');
}
}
return jsName;
@@ -447,8 +446,7 @@ class BaseNativeClassFinder implements NativeClassFinder {
ClassEntity owner = _tagOwner[tag];
if (owner != null) {
if (owner != cls) {
- throw new SpannableAssertionFailure(
- cls, "Tag '$tag' already in use by '${owner.name}'");
+ failedAt(cls, "Tag '$tag' already in use by '${owner.name}'");
}
} else {
_tagOwner[tag] = cls;
@@ -620,7 +618,7 @@ String readAnnotationName(
Iterable<ConstantValue> fields = constructedObject.fields.values;
// TODO(sra): Better validation of the constant.
if (fields.length != 1 || fields.single is! StringConstantValue) {
- throw new SpannableAssertionFailure(
+ failedAt(
spannable, 'Annotations needs one string: ${value.toStructuredText()}');
}
StringConstantValue specStringConstant = fields.single;
« no previous file with comments | « pkg/compiler/lib/src/kernel/native_basic_data.dart ('k') | pkg/compiler/lib/src/native/ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698