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

Unified Diff: pkg/compiler/lib/src/js_backend/constant_emitter.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/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/enqueuer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/constant_emitter.dart
diff --git a/pkg/compiler/lib/src/js_backend/constant_emitter.dart b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
index 4d2a9590e3973cd41ac524692653c1eea16babff..f1528f4f9fa533889c6ccce063b468f789672465 100644
--- a/pkg/compiler/lib/src/js_backend/constant_emitter.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
@@ -80,7 +80,7 @@ class ConstantEmitter implements ConstantValueVisitor<jsAst.Expression, Null> {
@override
jsAst.Expression visitFunction(FunctionConstantValue constant, [_]) {
- throw new SpannableAssertionFailure(NO_LOCATION_SPANNABLE,
+ throw failedAt(NO_LOCATION_SPANNABLE,
"The function constant does not need specific JS code.");
}
@@ -248,10 +248,8 @@ class ConstantEmitter implements ConstantValueVisitor<jsAst.Expression, Null> {
} else if (field.name == JavaScriptMapConstant.JS_DATA_NAME) {
arguments.add(jsGeneralMap());
} else {
- throw new SpannableAssertionFailure(
- field,
- "Compiler has unexpected field ${field.name} for "
- "${className}.");
+ failedAt(field,
+ "Compiler has unexpected field ${field.name} for ${className}.");
}
emittedArgumentCount++;
}, includeSuperAndInjectedMembers: true);
@@ -261,7 +259,7 @@ class ConstantEmitter implements ConstantValueVisitor<jsAst.Expression, Null> {
emittedArgumentCount != 4) ||
(className == JavaScriptMapConstant.DART_GENERAL_CLASS &&
emittedArgumentCount != 1)) {
- throw new SpannableAssertionFailure(classElement,
+ failedAt(classElement,
"Compiler and ${className} disagree on number of fields.");
}
@@ -302,7 +300,7 @@ class ConstantEmitter implements ConstantValueVisitor<jsAst.Expression, Null> {
case SyntheticConstantKind.NAME:
return constant.payload;
default:
- throw new SpannableAssertionFailure(NO_LOCATION_SPANNABLE,
+ throw failedAt(NO_LOCATION_SPANNABLE,
"Unexpected DummyConstantKind ${constant.kind}");
}
}
@@ -347,7 +345,7 @@ class ConstantEmitter implements ConstantValueVisitor<jsAst.Expression, Null> {
jsAst.Expression _reifiedTypeArguments(ResolutionInterfaceType type) {
jsAst.Expression unexpected(TypeVariableType _variable) {
ResolutionTypeVariableType variable = _variable;
- throw new SpannableAssertionFailure(
+ throw failedAt(
NO_LOCATION_SPANNABLE,
"Unexpected type variable '${variable.getStringAsDeclared(null)}'"
" in constant type '${type.getStringAsDeclared(null)}'");
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/enqueuer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698