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

Unified Diff: pkg/compiler/lib/src/native/ssa.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/native/resolver.dart ('k') | pkg/compiler/lib/src/parser/node_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/native/ssa.dart
diff --git a/pkg/compiler/lib/src/native/ssa.dart b/pkg/compiler/lib/src/native/ssa.dart
index ad454847e7022e273dde2ebc13bd9aad31dacfb6..5fc3b5da1c59ea1a71a7df222e3c21e54510fce4 100644
--- a/pkg/compiler/lib/src/native/ssa.dart
+++ b/pkg/compiler/lib/src/native/ssa.dart
@@ -48,8 +48,7 @@ void handleSsaNative(SsaAstGraphBuilder builder, Expression nativeBody) {
LiteralString jsCode = nativeBody.asLiteralString();
String str = jsCode.dartString.slowToString();
if (nativeRedirectionRegExp.hasMatch(str)) {
- throw new SpannableAssertionFailure(
- nativeBody, "Deprecated syntax, use @JSName('name') instead.");
+ failedAt(nativeBody, "Deprecated syntax, use @JSName('name') instead.");
}
hasBody = true;
}
@@ -89,8 +88,7 @@ void handleSsaNative(SsaAstGraphBuilder builder, Expression nativeBody) {
} else if (element.kind == ElementKind.SETTER) {
nativeMethodCall = '$receiver$nativeMethodName = $foreignParameters';
} else {
- throw new SpannableAssertionFailure(
- element, 'Unexpected kind: "${element.kind}".');
+ failedAt(element, 'Unexpected kind: "${element.kind}".');
}
builder.push(new HForeignCode(
@@ -107,7 +105,7 @@ void handleSsaNative(SsaAstGraphBuilder builder, Expression nativeBody) {
.addSuccessor(builder.graph.exit);
} else {
if (parameters.parameterCount != 0) {
- throw new SpannableAssertionFailure(
+ failedAt(
nativeBody,
'native "..." syntax is restricted to '
'functions with zero parameters.');
« no previous file with comments | « pkg/compiler/lib/src/native/resolver.dart ('k') | pkg/compiler/lib/src/parser/node_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698